Class: H2o::BlockContext

Inherits:
DataObject show all
Defined in:
lib/h2o/context.rb

Constant Summary

Constants inherited from DataObject

DataObject::INTERNAL_METHOD

Instance Method Summary collapse

Methods inherited from DataObject

#respond_to?

Constructor Details

#initialize(block, context, stream, index) ⇒ BlockContext

Returns a new instance of BlockContext.



134
135
136
# File 'lib/h2o/context.rb', line 134

def initialize(block, context, stream, index)
  @block, @context, @stream, @index = block, context, stream, index
end

Instance Method Details

#depthObject



143
144
145
# File 'lib/h2o/context.rb', line 143

def depth
  @index.abs
end

#nameObject



147
148
149
# File 'lib/h2o/context.rb', line 147

def name
  @block.name
end

#superObject



138
139
140
141
# File 'lib/h2o/context.rb', line 138

def super
  @block.parent.render(@context, @stream, @index-1) if @block.parent.stack_size > @index.abs
  nil
end