Class: Blocks::BlockDefinition
- Inherits:
-
OptionsSet
- Object
- Hash
- HashWithRenderStrategy
- OptionsSet
- Blocks::BlockDefinition
- Defined in:
- lib/blocks/builders/block_definition.rb
Constant Summary
Constants inherited from HashWithRenderStrategy
HashWithRenderStrategy::RENDERING_STRATEGIES, HashWithRenderStrategy::RENDER_WITH_BLOCK, HashWithRenderStrategy::RENDER_WITH_PARTIAL, HashWithRenderStrategy::RENDER_WITH_PROXY
Instance Attribute Summary collapse
-
#anonymous ⇒ Object
Returns the value of attribute anonymous.
-
#hooks ⇒ Object
Returns the value of attribute hooks.
-
#skip_completely ⇒ Object
Returns the value of attribute skip_completely.
-
#skip_content ⇒ Object
Returns the value of attribute skip_content.
Attributes inherited from OptionsSet
Attributes inherited from HashWithRenderStrategy
Instance Method Summary collapse
- #hooks_for(hook_type, initialize_when_missing: false) ⇒ Object
- #hooks_present? ⇒ Boolean
-
#initialize ⇒ BlockDefinition
constructor
A new instance of BlockDefinition.
- #skip(completely = false) ⇒ Object
- #skip_completely? ⇒ Boolean
- #skip_content? ⇒ Boolean
Methods inherited from OptionsSet
#inspect, #render_strategy, #render_strategy_item, #renders_with_proxy?, #reverse_merge!
Methods inherited from HashWithRenderStrategy
#except, #extractable_options?, #nested_under_indifferent_access, #render_strategy_and_item, #render_strategy_item, #renders_with_proxy?, #reverse_merge!, #slice, #to_hash, #to_s
Constructor Details
#initialize ⇒ BlockDefinition
Returns a new instance of BlockDefinition.
10 11 12 13 |
# File 'lib/blocks/builders/block_definition.rb', line 10 def initialize(*) self.hooks = Hash.new {|hash, key| hash[key] = [] } super end |
Instance Attribute Details
#anonymous ⇒ Object
Returns the value of attribute anonymous.
5 6 7 |
# File 'lib/blocks/builders/block_definition.rb', line 5 def anonymous @anonymous end |
#hooks ⇒ Object
Returns the value of attribute hooks.
5 6 7 |
# File 'lib/blocks/builders/block_definition.rb', line 5 def hooks @hooks end |
#skip_completely ⇒ Object
Returns the value of attribute skip_completely.
5 6 7 |
# File 'lib/blocks/builders/block_definition.rb', line 5 def skip_completely @skip_completely end |
#skip_content ⇒ Object
Returns the value of attribute skip_content.
5 6 7 |
# File 'lib/blocks/builders/block_definition.rb', line 5 def skip_content @skip_content end |
Instance Method Details
#hooks_for(hook_type, initialize_when_missing: false) ⇒ Object
28 29 30 |
# File 'lib/blocks/builders/block_definition.rb', line 28 def hooks_for(hook_type, initialize_when_missing: false) hooks[hook_type] if initialize_when_missing || hooks.key?(hook_type) end |
#hooks_present? ⇒ Boolean
32 33 34 |
# File 'lib/blocks/builders/block_definition.rb', line 32 def hooks_present? hooks.present? end |
#skip(completely = false) ⇒ Object
15 16 17 18 |
# File 'lib/blocks/builders/block_definition.rb', line 15 def skip(completely=false) self.skip_content = true self.skip_completely = completely end |
#skip_completely? ⇒ Boolean
24 25 26 |
# File 'lib/blocks/builders/block_definition.rb', line 24 def skip_completely? !!skip_completely end |
#skip_content? ⇒ Boolean
20 21 22 |
# File 'lib/blocks/builders/block_definition.rb', line 20 def skip_content? !!skip_content end |