Created
April 26, 2012 16:17
-
-
Save solnic/2500694 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class User | |
| include Virtus | |
| attribute :address do | |
| attribute :street, String | |
| attribute :city, String | |
| attribute :zipcode, String | |
| end | |
| end | |
| # or maybe | |
| class User | |
| include Virtus | |
| embed :address do | |
| attribute :street, String | |
| attribute :city, String | |
| attribute :zipcode, String | |
| end | |
| end | |
| user = User.new(:address => { :street => 'Foo', :city => 'Bar', :zipcode => '1234' }) |
Author
@lucapette to be honest I don't like "attr" abbreviation in general :) embed sounds/looks good IMHO
@solnic Yeah I know. You're right ;) I've update the comment just after I've done it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or ever
attr_embed? Hard choice anyway. No OK I don't likeattr_embed:) It's definitely an hard choice :)