Class: Datagrid::Columns::Column::ResponseFormat

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

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ ResponseFormat

Returns a new instance of ResponseFormat.

Yields:

  • (_self)

Yield Parameters:


7
8
9
# File 'lib/datagrid/columns/column.rb', line 7

def initialize
  yield(self)
end

Instance Attribute Details

#data_blockObject

Returns the value of attribute data_block


5
6
7
# File 'lib/datagrid/columns/column.rb', line 5

def data_block
  @data_block
end

#html_blockObject

Returns the value of attribute html_block


5
6
7
# File 'lib/datagrid/columns/column.rb', line 5

def html_block
  @html_block
end

Instance Method Details

#call_dataObject


19
20
21
# File 'lib/datagrid/columns/column.rb', line 19

def call_data
  data_block.call
end

#call_html(context) ⇒ Object


27
28
29
# File 'lib/datagrid/columns/column.rb', line 27

def call_html(context)
  context.instance_eval(&html_block)
end

#data(&block) ⇒ Object


11
12
13
# File 'lib/datagrid/columns/column.rb', line 11

def data(&block)
  self.data_block = block
end

#html(&block) ⇒ Object


15
16
17
# File 'lib/datagrid/columns/column.rb', line 15

def html(&block)
  self.html_block = block
end

#to_sObject


23
24
25
# File 'lib/datagrid/columns/column.rb', line 23

def to_s
  call_data.to_s
end