Class: Pancake::Mixins::Render::ViewContext::InheritanceHelper
- Defined in:
- lib/pancake/mixins/render/view_context.rb
Instance Attribute Summary collapse
-
#blocks ⇒ Object
readonly
Returns the value of attribute blocks.
-
#current_label ⇒ Object
Returns the value of attribute current_label.
-
#inherits_from ⇒ Object
Returns the value of attribute inherits_from.
-
#super_index ⇒ Object
readonly
Returns the value of attribute super_index.
Instance Method Summary collapse
- #block_for(label) ⇒ Object
- #decrement_super! ⇒ Object
- #increment_super! ⇒ Object
-
#initialize ⇒ InheritanceHelper
constructor
A new instance of InheritanceHelper.
Constructor Details
#initialize ⇒ InheritanceHelper
Returns a new instance of InheritanceHelper.
136 137 138 139 |
# File 'lib/pancake/mixins/render/view_context.rb', line 136 def initialize @blocks = Hash.new{|h,k| h[k] = []} @super_index = 0 end |
Instance Attribute Details
#blocks ⇒ Object (readonly)
Returns the value of attribute blocks.
134 135 136 |
# File 'lib/pancake/mixins/render/view_context.rb', line 134 def blocks @blocks end |
#current_label ⇒ Object
Returns the value of attribute current_label.
133 134 135 |
# File 'lib/pancake/mixins/render/view_context.rb', line 133 def current_label @current_label end |
#inherits_from ⇒ Object
Returns the value of attribute inherits_from.
133 134 135 |
# File 'lib/pancake/mixins/render/view_context.rb', line 133 def inherits_from @inherits_from end |
#super_index ⇒ Object (readonly)
Returns the value of attribute super_index.
134 135 136 |
# File 'lib/pancake/mixins/render/view_context.rb', line 134 def super_index @super_index end |
Instance Method Details
#block_for(label) ⇒ Object
141 142 143 |
# File 'lib/pancake/mixins/render/view_context.rb', line 141 def block_for(label) @blocks[label][@super_index] end |
#decrement_super! ⇒ Object
149 150 151 |
# File 'lib/pancake/mixins/render/view_context.rb', line 149 def decrement_super! @super_index -= 1 end |
#increment_super! ⇒ Object
145 146 147 |
# File 'lib/pancake/mixins/render/view_context.rb', line 145 def increment_super! @super_index += 1 end |