Method: Datagrid::Core::ClassMethods#dynamic
- Defined in:
- lib/datagrid/core.rb
#dynamic(&block) ⇒ void
This method returns an undefined value.
Allows dynamic columns definition, that could not be defined at class level Columns that depend on the database state or third party service can be defined this way.
135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/datagrid/core.rb', line 135 def dynamic(&block) previous_block = dynamic_block self.dynamic_block = if previous_block proc { instance_eval(&previous_block) instance_eval(&block) } else block end end |