Class: Amrita2::Runtime::Context
Overview
:nodoc:
Instance Attribute Summary collapse
-
#current_binding ⇒ Object
Returns the value of attribute current_binding.
-
#current_data ⇒ Object
Returns the value of attribute current_data.
-
#main_stream ⇒ Object
readonly
Returns the value of attribute main_stream.
-
#mv_index ⇒ Object
readonly
Returns the value of attribute mv_index.
-
#sub_streams ⇒ Object
readonly
Returns the value of attribute sub_streams.
Instance Method Summary collapse
- #clear_substream(key) ⇒ Object
-
#initialize(stream = "", old_context = nil, opt = {}) ⇒ Context
constructor
A new instance of Context.
- #sub_stream(key) ⇒ Object
Constructor Details
#initialize(stream = "", old_context = nil, opt = {}) ⇒ Context
Returns a new instance of Context.
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/amrita2/core.rb', line 285 def initialize(stream="", old_context=nil, opt={}) @sub_streams = {} if old_context @sub_streams = old_context.sub_streams if opt[:inherit_sub_streams] @main_stream = (stream or old_context.main_stream) @current_binding = (opt[:binding] or old_context.current_binding) @current_data = (opt[:data] or old_context.current_data) @mv_index = old_context.mv_index else @main_stream = (stream or "") @current_binding = TOPLEVEL_BINDING @current_data = nil @mv_index = {} end end |
Instance Attribute Details
#current_binding ⇒ Object
Returns the value of attribute current_binding.
283 284 285 |
# File 'lib/amrita2/core.rb', line 283 def current_binding @current_binding end |
#current_data ⇒ Object
Returns the value of attribute current_data.
283 284 285 |
# File 'lib/amrita2/core.rb', line 283 def current_data @current_data end |
#main_stream ⇒ Object (readonly)
Returns the value of attribute main_stream.
282 283 284 |
# File 'lib/amrita2/core.rb', line 282 def main_stream @main_stream end |
#mv_index ⇒ Object (readonly)
Returns the value of attribute mv_index.
282 283 284 |
# File 'lib/amrita2/core.rb', line 282 def mv_index @mv_index end |
#sub_streams ⇒ Object (readonly)
Returns the value of attribute sub_streams.
282 283 284 |
# File 'lib/amrita2/core.rb', line 282 def sub_streams @sub_streams end |