class Psych::Visitors::YAMLTree::Registrar
:nodoc:
def id_for target
def id_for target @obj_to_id[target.object_id] ||= (@counter += 1) end
def initialize
def initialize @obj_to_id = {} @obj_to_node = {} @targets = [] @counter = 0 end
def key? target
def key? target @obj_to_node.key? target.object_id rescue NoMethodError false end
def node_for target
def node_for target @obj_to_node[target.object_id] end
def register target, node
def register target, node @targets << target @obj_to_node[target.object_id] = node end