Module: Spreedly::Fields::ClassMethods
- Defined in:
- lib/spreedly/common/fields.rb
Instance Method Summary collapse
Instance Method Details
#field(*fields_to_add) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/spreedly/common/fields.rb', line 23 def field(*fields_to_add) = fields_to_add. @fields ||= [] fields_to_add.each do |f| @fields += [ f ] add_accessor_for(f, [:type]) end end |
#fields ⇒ Object
32 33 34 |
# File 'lib/spreedly/common/fields.rb', line 32 def fields @fields ||= [] end |
#inherited(subclass) ⇒ Object
36 37 38 |
# File 'lib/spreedly/common/fields.rb', line 36 def inherited(subclass) subclass.instance_variable_set("@fields", instance_variable_get("@fields")) end |