Class: Spina::Parts::BlockReference
- Inherits:
-
Base
- Object
- Base
- Spina::Parts::BlockReference
- Includes:
- BlockFilterable
- Defined in:
- app/models/spina/parts/block_reference.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #content ⇒ Object
-
#custom_block_name ⇒ Object
Returns the custom_block key from options, supporting both symbol and string keys.
-
#custom_block_record ⇒ Object
Looks up the custom block record by key.
Methods included from BlockFilterable
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'app/models/spina/parts/block_reference.rb', line 10 def @options end |
Instance Method Details
#content ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/models/spina/parts/block_reference.rb', line 12 def content if custom_block_name.present? custom_block_record else ::Spina::Blocks::Block.active.find_by(id: block_id) end end |
#custom_block_name ⇒ Object
Returns the custom_block key from options, supporting both symbol and string keys
21 22 23 24 25 |
# File 'app/models/spina/parts/block_reference.rb', line 21 def custom_block_name return if .blank? [:custom_block] || ["custom_block"] end |