Module: DigitalOpera::Document::ClassMethods
- Defined in:
- lib/digital_opera/document.rb
Instance Method Summary collapse
-
#field(name, options = {}) ⇒ Field
Defines all the fields that are accessible on the Document For each field that is defined, a getter and setter will be added as an instance method to the Document.
Instance Method Details
#field(name, options = {}) ⇒ Field
Defines all the fields that are accessible on the Document For each field that is defined, a getter and setter will be added as an instance method to the Document.
31 32 33 34 35 36 37 38 |
# File 'lib/digital_opera/document.rb', line 31 def field(name, = {}) named = name.to_s added = add_field(named, ) descendants.each do |subclass| subclass.add_field(named, ) end added end |