RevSpringPhoenix/arkenstone — pull request #59 by swilliams (2014-05-29 17:24:53+00:00)
Title: Fixed bug with trying to set a readonly property

# Why?
If an API returns an object with a key that corresponds to a method on the model, it'll try to call `method_name=`, which is not guaranteed to exist. For example, take this class:

```ruby
class Something
include Arkenstone::Document
attributes :name

def foo
#snip
end
end
```

If it receives this JSON response:

```json
{
"name": "Derp Derp",
"foo": "uh oh"
}
```

It'll try to call `foo=`, which will crash.

# What Changed?
Instead of checking for just the key of a JSON response, I added a check for `"#{key}=` before setting. I'm also concerned about the fact that *any* setter will be called if it exists on the model. I'll create a separate issue for that.