Skip to content

Commit

Permalink
Add information about EV to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
solnic committed Jan 8, 2012
1 parent a40193f commit ba8a6f4
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion README.md
Expand Up @@ -23,7 +23,7 @@ or
``` ruby
# ./Gemfile

gem 'virtus', '0.0.7'
gem 'virtus'
```

Examples
Expand Down Expand Up @@ -78,6 +78,37 @@ page.views
# => 0
```

**Embedded Value**

``` ruby
class City
include Virtus

attribute :name, String
end

class Address
include Virtus

attribute :street, String
attribute :zipcode, String
attribute :city, City
end

class User
include Virtus

attribute :name, String
attribute :address, Address
end

user = User.new(:address => {
:street => 'Street 1/2', :zipcode => '12345', :city => { :name => 'NYC' } })

user.address.street # => "Street 1/2"
user.address.city.name # => "NYC"
```

**Adding Coercions**

Virtus comes with a builtin coercion library.
Expand Down

0 comments on commit ba8a6f4

Please sign in to comment.