Class: Resilience::ObjectTree
- Inherits:
-
Object
- Object
- Resilience::ObjectTree
- Includes:
- OnImage
- Defined in:
- lib/resilience/trees/object_tree.rb
Instance Attribute Summary collapse
-
#map ⇒ Object
Returns the value of attribute map.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ObjectTree
constructor
A new instance of ObjectTree.
-
#page ⇒ Object
Depends on Image Pages extraction.
- #parse_entries ⇒ Object
Methods included from OnImage
#image, image, included, restore_pos, #restore_pos, store_pos, #store_pos
Constructor Details
#initialize ⇒ ObjectTree
Returns a new instance of ObjectTree.
11 12 13 |
# File 'lib/resilience/trees/object_tree.rb', line 11 def initialize @map ||= {} end |
Instance Attribute Details
#map ⇒ Object
Returns the value of attribute map.
9 10 11 |
# File 'lib/resilience/trees/object_tree.rb', line 9 def map @map end |
Class Method Details
.parse ⇒ Object
15 16 17 18 19 |
# File 'lib/resilience/trees/object_tree.rb', line 15 def self.parse tree = new tree.parse_entries tree end |
Instance Method Details
#page ⇒ Object
Depends on Image Pages extraction
22 23 24 |
# File 'lib/resilience/trees/object_tree.rb', line 22 def page image.pages.newest_for PAGES[:object_table] end |
#parse_entries ⇒ Object
26 27 28 29 30 31 32 33 |
# 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 |