Skip to content

Instantly share code, notes, and snippets.

@solnic
Created April 26, 2012 16:17
Show Gist options
  • Select an option

  • Save solnic/2500694 to your computer and use it in GitHub Desktop.

Select an option

Save solnic/2500694 to your computer and use it in GitHub Desktop.
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' })
@lucapette
Copy link
Copy Markdown

or ever attr_embed? Hard choice anyway. No OK I don't like attr_embed :) It's definitely an hard choice :)

@solnic
Copy link
Copy Markdown
Author

solnic commented Apr 26, 2012

@lucapette to be honest I don't like "attr" abbreviation in general :) embed sounds/looks good IMHO

@lucapette
Copy link
Copy Markdown

@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