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.



471
472
473
474
# File 'lib/datagrid/columns.rb', line 471

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



476
477
478
479
480
481
482
# File 'lib/datagrid/columns.rb', line 476

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