Class: LabileRecord::Row

Inherits:
Array
  • Object
show all
Defined in:
lib/labilerecord.rb

Instance Method Summary collapse

Constructor Details

#initialize(fields) ⇒ Row

Returns a new instance of Row.



142
143
144
# File 'lib/labilerecord.rb', line 142

def initialize(fields)
  @fields = fields
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



146
147
148
149
150
151
152
# File 'lib/labilerecord.rb', line 146

def method_missing(meth, *args)
  if ( field_index = @fields.index(meth.id2name) )
    at field_index
  else
    super(meth, *args)
  end
end