Class: Ron::GraphEdge::Array
- Inherits:
-
Ron::GraphEdge
- Object
- Ron::GraphEdge
- Ron::GraphEdge::Array
- Defined in:
- lib/ron/graphedge.rb
Overview
Instance Attribute Summary
Attributes inherited from Ron::GraphEdge
Instance Method Summary collapse
-
#initialize(context, index, len = 1) ⇒ Array
constructor
A new instance of Array.
- #old_value ⇒ Object
- #replace(*newvals) ⇒ Object
Methods inherited from Ron::GraphEdge
#call, #context_type, #new_value
Constructor Details
#initialize(context, index, len = 1) ⇒ Array
Returns a new instance of Array.
237 238 239 240 241 242 243 244 245 |
# File 'lib/ron/graphedge.rb', line 237 def initialize(context,index,len=1) super if Range===@index @len=@index.last-@index.first @len-=1 if @len.exclude_end? @index=@index.first end end |
Instance Method Details
#old_value ⇒ Object
247 248 249 |
# File 'lib/ron/graphedge.rb', line 247 def old_value context[@index] end |
#replace(*newvals) ⇒ Object
255 256 257 258 |
# File 'lib/ron/graphedge.rb', line 255 def replace(*newvals) newvals.empty? and newvals=[new_value] context[@index]=*newvals end |