Class: FlexiView::Meta
- Inherits:
-
Object
- Object
- FlexiView::Meta
- Defined in:
- lib/flexi_view/meta.rb
Instance Attribute Summary collapse
-
#data_block ⇒ Object
Returns the value of attribute data_block.
-
#name ⇒ Object
Returns the value of attribute name.
-
#root_key ⇒ Object
Returns the value of attribute root_key.
Instance Method Summary collapse
-
#initialize(name, root_key, &data_block) ⇒ Meta
constructor
A new instance of Meta.
- #to_data(serializer) ⇒ Object
Constructor Details
#initialize(name, root_key, &data_block) ⇒ Meta
Returns a new instance of Meta.
7 8 9 10 11 |
# File 'lib/flexi_view/meta.rb', line 7 def initialize(name, root_key, &data_block) @name = name @root_key = root_key @data_block = data_block if block_given? end |
Instance Attribute Details
#data_block ⇒ Object
Returns the value of attribute data_block.
5 6 7 |
# File 'lib/flexi_view/meta.rb', line 5 def data_block @data_block end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/flexi_view/meta.rb', line 5 def name @name end |
#root_key ⇒ Object
Returns the value of attribute root_key.
5 6 7 |
# File 'lib/flexi_view/meta.rb', line 5 def root_key @root_key end |
Instance Method Details
#to_data(serializer) ⇒ Object
13 14 15 |
# File 'lib/flexi_view/meta.rb', line 13 def to_data(serializer) serializer.instance_exec(serializer.objects, &data_block) end |