Module: Archimate::DataModel::DiffablePrimitive::DiffablePrimitiveMethods
- Defined in:
- lib/archimate/data_model/diffable_primitive.rb
Instance Method Summary collapse
- #build_index(index_hash) ⇒ Object
- #clone ⇒ Object
- #compact! ⇒ Object
- #diff(other, from_parent, to_parent, attribute, from_attribute = nil) ⇒ Object
- #dup ⇒ Object
- #id ⇒ Object
- #in_model=(_m) ⇒ Object
- #parent=(_p) ⇒ Object
- #parent_attribute_name=(_attr_name) ⇒ Object
- #primitive? ⇒ Boolean
- #referenced_identified_nodes ⇒ Object
Instance Method Details
#build_index(index_hash) ⇒ Object
29 30 31 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 29 def build_index(index_hash) index_hash end |
#clone ⇒ Object
41 42 43 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 41 def clone self end |
#compact! ⇒ Object
49 50 51 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 49 def compact! self end |
#diff(other, from_parent, to_parent, attribute, from_attribute = nil) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 6 def diff(other, from_parent, to_parent, attribute, from_attribute = nil) from_attribute = attribute if from_attribute.nil? if other.nil? return [Diff::Delete.new( Diff::ArchimateNodeAttributeReference.new(from_parent, attribute) )] end raise TypeError, "Expected other #{other.class} to be of type #{self.class}" unless other.is_a?(self.class) unless self == other return [Diff::Change.new( Diff::ArchimateNodeReference.for_node(to_parent, attribute), Diff::ArchimateNodeReference.for_node(from_parent, from_attribute) )] end [] end |
#dup ⇒ Object
45 46 47 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 45 def dup self end |
#id ⇒ Object
37 38 39 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 37 def id object_id.to_s end |
#in_model=(_m) ⇒ Object
23 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 23 def in_model=(_m); end |
#parent=(_p) ⇒ Object
25 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 25 def parent=(_p); end |
#parent_attribute_name=(_attr_name) ⇒ Object
27 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 27 def parent_attribute_name=(_attr_name); end |
#primitive? ⇒ Boolean
33 34 35 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 33 def primitive? true end |
#referenced_identified_nodes ⇒ Object
53 54 55 |
# File 'lib/archimate/data_model/diffable_primitive.rb', line 53 def referenced_identified_nodes [] end |