Module: Fieldable
- Included in:
- Array, FieldedArray
- Defined in:
- lib/arrayfields.rb
Overview
fields set and subsequently be auto-extended by ArrayFields
Instance Method Summary collapse
-
#fields(*values) ⇒ Object
access to field list.
-
#fields=(fields) ⇒ Object
sets fields an dynamically extends this Array instance with methods for keyword access.
-
#fieldset ⇒ Object
access to fieldset.
Instance Method Details
#fields(*values) ⇒ Object
access to field list
319 320 321 322 |
# File 'lib/arrayfields.rb', line 319 def fields *values return(send('fields=', *values)) unless values.empty? fieldset and fieldset.fields end |
#fields=(fields) ⇒ Object
sets fields an dynamically extends this Array instance with methods for keyword access
300 301 302 303 304 305 306 307 308 309 |
# File 'lib/arrayfields.rb', line 300 def fields= fields extend ArrayFields unless ArrayFields === self @fieldset = if ArrayFields::FieldSet === fields fields else ArrayFields::FieldSet.new fields end end |
#fieldset ⇒ Object
access to fieldset
313 314 315 |
# File 'lib/arrayfields.rb', line 313 def fieldset @fieldset ||= nil end |