Class: Archimate::DataModel::Organization
- Inherits:
-
Object
- Object
- Archimate::DataModel::Organization
show all
- Includes:
- Comparison
- Defined in:
- lib/archimate/data_model/organization.rb
Overview
Note:
that Organization must fit into a tree structure (so strictly nested).
An organization element represents a structural node in a particular organization of the model concepts. An organization element may be a parent or sibling of other organization elements, each one representing a unique structural node.
An organization element may reference an ArchiMate element, ArchiMate relationship, or nothing (in which case it is a structural container)
An organization has no meaning unless it has at least child organization element.
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Comparison
#==, #[], #dig, #each, #hash, included, #pretty_print, #to_h
Constructor Details
#initialize(id: nil, name: nil, type: nil, documentation: nil, items: [], organizations: []) ⇒ Organization
# @return [Array<AnyElement>] model_attr :other_elements # @return [Array<AnyAttribute>] model_attr :other_attributes
46
47
48
49
50
51
52
53
54
|
# File 'lib/archimate/data_model/organization.rb', line 46
def initialize(id: nil, name: nil, type: nil, documentation: nil,
items: [], organizations: [])
@id = id
@name = name
@type = type
@documentation = documentation
@items = items
@organizations = organizations
end
|
Instance Attribute Details
33
|
# File 'lib/archimate/data_model/organization.rb', line 33
model_attr :documentation
|
#id ⇒ String, NilClass
22
|
# File 'lib/archimate/data_model/organization.rb', line 22
model_attr :id
|
#items ⇒ Array<Object>
36
|
# File 'lib/archimate/data_model/organization.rb', line 36
model_attr :items, writable: true
|
26
|
# File 'lib/archimate/data_model/organization.rb', line 26
model_attr :name
|
40
|
# File 'lib/archimate/data_model/organization.rb', line 40
model_attr :organizations, writable: true
|
#type ⇒ String, NilClass
30
|
# File 'lib/archimate/data_model/organization.rb', line 30
model_attr :type
|
Instance Method Details
#referenced_identified_nodes ⇒ Object
60
61
62
63
64
|
# File 'lib/archimate/data_model/organization.rb', line 60
def referenced_identified_nodes
organizations.reduce(items) do |a, e|
a.concat(e.referenced_identified_nodes)
end
end
|
#remove(id) ⇒ Object
66
67
68
|
# File 'lib/archimate/data_model/organization.rb', line 66
def remove(id)
items.delete_if { |item| item.id == id }
end
|