class Resilience::ObjectTree
Attributes
map[RW]
Public Class Methods
new()
click to toggle source
# File lib/resilience/trees/object_tree.rb, line 11 def initialize @map ||= {} end
parse()
click to toggle source
# File lib/resilience/trees/object_tree.rb, line 15 def self.parse tree = new tree.parse_entries tree end
Public Instance Methods
page()
click to toggle source
parse_entries()
click to toggle source
# File lib/resilience/trees/object_tree.rb, line 26 def parse_entries page.attributes.each { |attr| obj1 = obj1_from attr obj2 = obj2_from attr @map[obj1] ||= [] @map[obj1] << obj2 } end
Private Instance Methods
obj1_from(attr)
click to toggle source
# File lib/resilience/trees/object_tree.rb, line 37 def obj1_from(attr) attr.bytes[ADDRESSES[:object_tree_start1]..ADDRESSES[:object_tree_end1]] end
obj2_from(attr)
click to toggle source
# File lib/resilience/trees/object_tree.rb, line 41 def obj2_from(attr) attr.bytes[ADDRESSES[:object_tree_start2]..ADDRESSES[:object_tree_end2]] end