Class: Jekyll::Archimate::EntityBase
- Inherits:
-
Object
- Object
- Jekyll::Archimate::EntityBase
- Defined in:
- lib/jekyll/archimate/archimate_hook.rb
Overview
Base class for ArchiMate Entities: Model, Diagram, Element, Relationship
Direct Known Subclasses
DiagramEntity, ElementEntity, ModelEntity, RelationshipEntity
Instance Attribute Summary collapse
-
#entity ⇒ Object
readonly
Returns the value of attribute entity.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
- #attr_hash ⇒ Object
-
#initialize(entity, model: nil) ⇒ EntityBase
constructor
A new instance of EntityBase.
- #to_h ⇒ Object
Constructor Details
#initialize(entity, model: nil) ⇒ EntityBase
Returns a new instance of EntityBase.
17 18 19 20 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 17 def initialize(entity, model: nil) @entity = entity @model = model end |
Instance Attribute Details
#entity ⇒ Object (readonly)
Returns the value of attribute entity.
14 15 16 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 14 def entity @entity end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
15 16 17 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 15 def model @model end |
Instance Method Details
#attr_hash ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 26 def attr_hash { id: entity.id, name: entity.name, documentation: entity.documentation&.to_h, properties: entity.properties.map(&:to_h) } end |
#to_h ⇒ Object
22 23 24 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 22 def to_h Archimate.hash_purge(attr_hash) end |