Skip to content

Instantly share code, notes, and snippets.

@peczenyj
Created February 13, 2014 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peczenyj/8974302 to your computer and use it in GitHub Desktop.
Save peczenyj/8974302 to your computer and use it in GitHub Desktop.
example with ruby
2.1.0 :001 > require 'moosex'
=> true
2.1.0 :015 > class B
2.1.0 :016?> include MooseX.init(meta: true)
2.1.0 :017?> has :a
2.1.0 :018?> has [ :b, :c ]
2.1.0 :019?> has d: { doc: "d" }
2.1.0 :020?> has :e, is: :rw, doc: "eeee"
2.1.0 :021?> end
=> nil
2.1.0 :022 > B.meta.info
=> {:a=>"", :b=>"", :c=>"", :d=>"d", :e=>"eeee"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment