Class: Archimate::Export::JsonlEdge

Inherits:
Object
  • Object
show all
Defined in:
lib/archimate/export/jsonl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(relationship) ⇒ JsonlEdge

Returns a new instance of JsonlEdge.



91
92
93
# File 'lib/archimate/export/jsonl.rb', line 91

def initialize(relationship)
  @relationship = relationship
end

Instance Attribute Details

#relationshipObject (readonly)

Returns the value of attribute relationship.



89
90
91
# File 'lib/archimate/export/jsonl.rb', line 89

def relationship
  @relationship
end

Instance Method Details

#to_jsonlObject



95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/archimate/export/jsonl.rb', line 95

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: relationship.weight
  )
end