Class: Archimate::Export::JsonlNode

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ JsonlNode

Returns a new instance of JsonlNode.



68
69
70
# File 'lib/archimate/export/jsonl.rb', line 68

def initialize(element)
  @element = element
end

Instance Attribute Details

#elementObject (readonly)

Returns the value of attribute element.



66
67
68
# File 'lib/archimate/export/jsonl.rb', line 66

def element
  @element
end

Instance Method Details

#to_jsonlObject

n:BusinessActor ‘layer`: “Business”, `name`: Felix, `nodeId`: “d8e75068-df75-4c21-a2af-fab5c195687a”



76
77
78
79
80
81
82
83
84
85
# File 'lib/archimate/export/jsonl.rb', line 76

def to_jsonl
  Export.clean_json(
    _key: element.id,
    name: element.name&.to_s,
    layer: element.layer&.name&.to_s&.delete(" "),
    type: element.type,
    documentation: element.documentation&.to_s,
    properties: PropertiesHash.new(element.properties).to_h
  )
end