Class: Datagrid::Columns::DataRow

Inherits:
Object
  • Object
show all
Defined in:
lib/datagrid/columns.rb

Overview

InstanceMethods

Instance Method Summary collapse

Constructor Details

#initialize(grid, model) ⇒ DataRow

Returns a new instance of DataRow.



383
384
385
386
# File 'lib/datagrid/columns.rb', line 383

def initialize(grid, model)
  @grid = grid
  @model = model
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &blk) ⇒ Object



388
389
390
391
392
393
394
# File 'lib/datagrid/columns.rb', line 388

def method_missing(meth, *args, &blk)
  if column = @grid.column_by_name(meth)
    column.data_value(@model, @grid)
  else
    super
  end
end