Class: Pacer::Orient::TxDataWrapper
- Inherits:
-
Object
- Object
- Pacer::Orient::TxDataWrapper
- Defined in:
- lib/pacer-orient/tx_data_wrapper.rb
Instance Attribute Summary collapse
-
#blueprints_graph ⇒ Object
readonly
Returns the value of attribute blueprints_graph.
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#e_base ⇒ Object
readonly
Returns the value of attribute e_base.
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#v_base ⇒ Object
readonly
Returns the value of attribute v_base.
Instance Method Summary collapse
- #changed_e ⇒ Object
- #changed_v ⇒ Object
- #created_e ⇒ Object
- #created_e_ids ⇒ Object
- #created_v ⇒ Object
- #created_v_ids ⇒ Object
- #deleted?(e) ⇒ Boolean
- #deleted_e ⇒ Object
- #deleted_e_ids ⇒ Object
- #deleted_v ⇒ Object
- #deleted_v_ids ⇒ Object
- #entries ⇒ Object
-
#initialize(db, graph) ⇒ TxDataWrapper
constructor
A new instance of TxDataWrapper.
Constructor Details
#initialize(db, graph) ⇒ TxDataWrapper
Returns a new instance of TxDataWrapper.
8 9 10 11 12 13 14 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 8 def initialize(db, graph) @db = db @graph = graph @blueprints_graph = graph.blueprints_graph @v_base = graph.orient_graph.getMetadata.getSchema.getClass("V") @e_base = graph.orient_graph.getMetadata.getSchema.getClass("E") end |
Instance Attribute Details
#blueprints_graph ⇒ Object (readonly)
Returns the value of attribute blueprints_graph.
6 7 8 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 6 def blueprints_graph @blueprints_graph end |
#db ⇒ Object (readonly)
Returns the value of attribute db.
6 7 8 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 6 def db @db end |
#e_base ⇒ Object (readonly)
Returns the value of attribute e_base.
6 7 8 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 6 def e_base @e_base end |
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
6 7 8 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 6 def graph @graph end |
#v_base ⇒ Object (readonly)
Returns the value of attribute v_base.
6 7 8 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 6 def v_base @v_base end |
Instance Method Details
#changed_e ⇒ Object
36 37 38 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 36 def changed_e keep(ORecordOperation::UPDATED, e_base) { |e| changes e, :edge }.flatten end |
#changed_v ⇒ Object
24 25 26 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 24 def changed_v keep(ORecordOperation::UPDATED, v_base) { |e| changes e, :vertex }.flatten end |
#created_e ⇒ Object
28 29 30 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 28 def created_e keep(ORecordOperation::CREATED, e_base) { |e| wrap_edge e } end |
#created_e_ids ⇒ Object
48 49 50 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 48 def created_e_ids keep(ORecordOperation::CREATED, e_base) { |e| e.getIdentity } end |
#created_v ⇒ Object
16 17 18 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 16 def created_v keep(ORecordOperation::CREATED, v_base) { |e| wrap_vertex e } end |
#created_v_ids ⇒ Object
40 41 42 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 40 def created_v_ids keep(ORecordOperation::CREATED, v_base) { |e| e.getIdentity } end |
#deleted?(e) ⇒ Boolean
56 57 58 59 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 56 def deleted?(e) entry = db.getTransaction.getRecordEntry e.element_id entry and entry.type == ORecordOperation::DELETED end |
#deleted_e ⇒ Object
32 33 34 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 32 def deleted_e keep(ORecordOperation::DELETED, e_base) { |e| wrap_edge e } end |
#deleted_e_ids ⇒ Object
52 53 54 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 52 def deleted_e_ids keep(ORecordOperation::DELETED, e_base) { |e| e.getIdentity } end |
#deleted_v ⇒ Object
20 21 22 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 20 def deleted_v keep(ORecordOperation::DELETED, v_base) { |e| wrap_vertex e } end |
#deleted_v_ids ⇒ Object
44 45 46 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 44 def deleted_v_ids keep(ORecordOperation::DELETED, v_base) { |e| e.getIdentity } end |
#entries ⇒ Object
61 62 63 |
# File 'lib/pacer-orient/tx_data_wrapper.rb', line 61 def entries db.getTransaction.getCurrentRecordEntries end |