Class: Datagrid::Helper::HtmlRow

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

Instance Method Summary collapse

Constructor Details

#initialize(context, grid, asset) ⇒ HtmlRow

Returns a new instance of HtmlRow.



77
78
79
80
81
# File 'lib/datagrid/helper.rb', line 77

def initialize(context, grid, asset)
  @context = context
  @grid = grid
  @asset = asset
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



83
84
85
86
87
88
89
# File 'lib/datagrid/helper.rb', line 83

def method_missing(method, *args, &blk)
  if column = @grid.column_by_name(method)
    @context.datagrid_format_value(@grid, column, @asset)
  else
    super
  end
end