Module: Fieldable

Included in:
Array, FieldedArray
Defined in:
lib/rq/arrayfields.rb

Overview

fields set and subsequently be auto-extended by ArrayFields

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fieldsetObject (readonly)

access to fieldset



270
271
272
# File 'lib/rq/arrayfields.rb', line 270

def fieldset
  @fieldset
end

Instance Method Details

#fieldsObject

access to field list



274
275
276
# File 'lib/rq/arrayfields.rb', line 274

def fields
  @fieldset and @fieldset.fields
end

#fields=(fields) ⇒ Object

sets fields an dynamically extends this Array instance with methods for keyword access



257
258
259
260
261
262
263
264
265
266
# File 'lib/rq/arrayfields.rb', line 257

def fields= fields
  extend ArrayFields unless defined? @fieldset 

  @fieldset = 
    if ArrayFields::FieldSet === fields
      fields
    else
      ArrayFields::FieldSet.new fields
    end
end