Class: Archimate::Export::JsonlEdge
- Inherits:
-
Object
- Object
- Archimate::Export::JsonlEdge
- Defined in:
- lib/archimate/export/jsonl.rb
Constant Summary collapse
- WEIGHTS =
{ 'GroupingRelationship' => 0, 'JunctionRelationship' => 0, 'AssociationRelationship' => 0, 'SpecialisationRelationship' => 1, 'FlowRelationship' => 2, 'TriggeringRelationship' => 3, 'InfluenceRelationship' => 4, 'AccessRelationship' => 5, 'UsedByRelationship' => 6, 'RealisationRelationship' => 7, 'AssignmentRelationship' => 8, 'AggregationRelationship' => 9, 'CompositionRelationship' => 10 }
Instance Attribute Summary collapse
-
#relationship ⇒ Object
readonly
Returns the value of attribute relationship.
Instance Method Summary collapse
-
#initialize(relationship) ⇒ JsonlEdge
constructor
A new instance of JsonlEdge.
- #to_jsonl ⇒ Object
Constructor Details
#initialize(relationship) ⇒ JsonlEdge
Returns a new instance of JsonlEdge.
109 110 111 |
# File 'lib/archimate/export/jsonl.rb', line 109 def initialize(relationship) @relationship = relationship end |
Instance Attribute Details
#relationship ⇒ Object (readonly)
Returns the value of attribute relationship.
107 108 109 |
# File 'lib/archimate/export/jsonl.rb', line 107 def relationship @relationship end |
Instance Method Details
#to_jsonl ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/archimate/export/jsonl.rb', line 113 def to_jsonl Export.clean_json( { _key: relationship.id, _from: relationship.source, _to: relationship.target, name: relationship.name&.to_s, type: relationship.type, accessType: relationship.access_type, documentation: relationship.documentation&.to_s, properties: PropertiesHash.new(relationship.properties).to_h, weight: weight } ) end |