Class: Pancake::Mixins::Render::ViewContext::InheritanceHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/pancake/mixins/render/view_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInheritanceHelper

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

#blocksObject (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_labelObject

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_fromObject

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_indexObject (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