Nico-Taing/yaml_record — Issue #5: Add array type for property
Author: nesquena
Created: 2012-02-01 08:52:10+00:00
State: open

Once we have typecasting, we should support array as a type:

```ruby
class Post < YamlRecord::Base
property :names, Array
property :user_ids, Array, Integer
end
```

and that should allow:

```ruby
p = Post.new
p.names = ["Bob", "Jane"]
p.user_ids = [1,2,3,4,5]
p.save
```

to

```yaml
---
names: ["Bob", "Jane"]
user_id: [1,2,3,4,5]
```

but also support lists in string form:

```ruby
p = Post.new
p.names = "Bob, Jane"
p.user_ids = "1, 2, 3, 4, 5"
p.save
p.names # => ["Bob", "Jane"]
p.user_ids # => [1,2,3,4,5]
```