Module: Gorillib::Builder::ClassMethods
- Includes:
- Model::ClassMethods
- Included in:
- FancyBuilder::ClassMethods
- Defined in:
- lib/gorillib/builder.rb
Instance Method Summary collapse
-
#collection(field_name, item_type, options = {}) ⇒ Object
FIXME: this interface is borked -- it should not take the item_type in the second slot.
- #magic(field_name, type, options = {}) ⇒ Object
- #member(field_name, type, options = {}) ⇒ Object
Methods included from Model::ClassMethods
#assemble_positionals, #attrs_hash_from_args, #field, #field_names, #fields, #from_tuple, #has_field?, #inspect, #inspect_compact, #native?, #positionals, #receive, #typename
Instance Method Details
#collection(field_name, item_type, options = {}) ⇒ Object
FIXME: this interface is borked -- it should not take the item_type in the second slot.
111 112 113 114 |
# File 'lib/gorillib/builder.rb', line 111 def collection(field_name, item_type, ={}) super(field_name, Gorillib::ModelCollection, { :item_type => item_type, :field_type => ::Gorillib::Builder::GetsetCollectionField }.merge()) end |
#magic(field_name, type, options = {}) ⇒ Object
103 104 105 |
# File 'lib/gorillib/builder.rb', line 103 def magic(field_name, type, ={}) field(field_name, type, {:field_type => ::Gorillib::Builder::GetsetField}.merge()) end |
#member(field_name, type, options = {}) ⇒ Object
106 107 108 |
# File 'lib/gorillib/builder.rb', line 106 def member(field_name, type, ={}) field(field_name, type, {:field_type => ::Gorillib::Builder::MemberField}.merge()) end |