Class: Ron::GraphEdge

Inherits:
Object show all
Defined in:
lib/ron/graphedge.rb

Overview


represents an edge along the ruby object graph. (Container and position within it.)

Defined Under Namespace

Classes: Array, BracketsKey, BracketsValue, ContextWasRecycled, HashDefaultKey, HashDefaultValue, HashKey, HashValue, ObjectIvarValue, ObjectMethValue, ObjectName, ReplaceAtTopLevel, SetMember, TopLevel

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, index, len = 1, &newval_code) ⇒ GraphEdge

Returns a new instance of GraphEdge.



215
216
217
218
219
# File 'lib/ron/graphedge.rb', line 215

def initialize(context,index,len=1,&newval_code)
   len>=0 or raise ArgumentError
  @context,@index,@len,@newval_code=context,index,len,newval_code
  fail unless @context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



220
221
222
# File 'lib/ron/graphedge.rb', line 220

def context
  @context
end

#indexObject (readonly)

Returns the value of attribute index.



220
221
222
# File 'lib/ron/graphedge.rb', line 220

def index
  @index
end

#lenObject (readonly)

Returns the value of attribute len.



220
221
222
# File 'lib/ron/graphedge.rb', line 220

def len
  @len
end

Instance Method Details

#callObject



225
# File 'lib/ron/graphedge.rb', line 225

def call; replace; end

#context_typeObject

def new_value_set!(&nv) @newval_code=nv end



223
# File 'lib/ron/graphedge.rb', line 223

def context_type; self.class end

#new_valueObject

def context_died

  @context=nil
end


231
232
233
# File 'lib/ron/graphedge.rb', line 231

def new_value
  @newval_code[self]
end