maeve/modelish — Issue #7: Type conversions are not applied for Modelish::Base#[]
Author: maeve
Created: 2012-02-22 19:02:18+00:00
State: open
Labels: bug

Given the following modelish object:

```ruby
class MyModel < Modelish::Base
property :my_prop, :type => Integer
end

model = MyModel.new(:my_prop => "42")
```

When you access the property through the auto-generated accessor, it will perform the type conversion, but if you access the property through the square-bracket hash syntax, it returns the raw, unconverted value:

```ruby
model.my_prop
# => 42
model[:my_prop]
# => "42"
```

The `Modelish::Base#[]` method is currently borrowed from hashie. We need to re-implement it to support modelish-specific concepts like property types (this will probably entail refactoring the property type code as well).