ascheink/nytimes-style — pull request #4 by mtigas (2014-05-13 18:48:59+00:00)
Title: prevent instance variable collision: `@states`

(`@states` on L76 being the cache of lazy-loaded states.yml for `nytimes_state_abbrev`)

this instance variable may be clobbered by any instance that includes Nytimes::Style.

i.e., a view using the following controller would blow up on `nytimes_state_abbrev("MO")`

```
include Nytimes::Style

class FooController < ApplicationController
def index
@states = [] # i.e. State.where('...')
end
end
```

all the other functions in `Nytimes::Style` are prefixed with `nytimes_`; likewise, this
commit turns `@states` into `@_nytimes_states` to try to avoid name collisions (and instance var
clobbering) as much as possible.

(In theory, an instance var is a terrible idea on a module since the implementing
class can do anything to the instances later, but in this case it appears to
be a cludgy-yet-ideal solution since we want to lazy-load and then instance
cache the result of loading `states.yml`.)