Class: FluidTable::Context
- Inherits:
-
Struct
- Object
- Struct
- FluidTable::Context
- Defined in:
- lib/fluid_table/context.rb
Instance Attribute Summary collapse
-
#record ⇒ Object
Returns the value of attribute record.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object (private)
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fluid_table/context.rb', line 15 def method_missing(method, *args) if table.view if block_given? table.view.send(method, *args) { |*block_args| yield(*block_args) } else table.view.send(method, *args) end else block_given? ? super { |*block_args| yield(*block_args) } : super end end |
Instance Attribute Details
#record ⇒ Object
Returns the value of attribute record
2 3 4 |
# File 'lib/fluid_table/context.rb', line 2 def record @record end |
#table ⇒ Object
Returns the value of attribute table
2 3 4 |
# File 'lib/fluid_table/context.rb', line 2 def table @table end |
Instance Method Details
#respond_to?(method) ⇒ Boolean
8 9 10 |
# File 'lib/fluid_table/context.rb', line 8 def respond_to?(method) view && view.respond_to?(method) end |
#view ⇒ Object
4 5 6 |
# File 'lib/fluid_table/context.rb', line 4 def view table.view if table end |