Class: Archimate::DataModel::Organization
- Inherits:
-
Object
- Object
- Archimate::DataModel::Organization
- Includes:
- Comparison, Referenceable
- Defined in:
- lib/archimate/data_model/organization.rb
Overview
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
- #documentation ⇒ PreservedLangString, NilClass readonly
-
#id ⇒ String, NilClass
readonly
Format should match /[[[:alpha:]]_]*/ to be valid for Archimate Model exchange format.
- #items ⇒ Array<Object>
-
#name ⇒ LangString, NilClass
readonly
LabelGroup in the XSD.
-
#organizations ⇒ Array<Organization>
item in the XSD.
-
#type ⇒ String, NilClass
readonly
I believe this is used only for Archi formats.
Instance Method Summary collapse
- #other_attributes ⇒ Array<AnyAttribute>
- #other_elements ⇒ Array<AnyElement>
- #remove(id) ⇒ Object
- #remove_reference(item) ⇒ Object
- #replace_item_with(item, replacement) ⇒ Object
- #to_s ⇒ Object
Methods included from Referenceable
#add_reference, #destroy, #model, #references, #replace_with
Methods included from Comparison
#==, #[], #dig, #each, #hash, included, #initialize, #inspect, #pretty_print, #to_h
Instance Attribute Details
#documentation ⇒ PreservedLangString, NilClass (readonly)
34 |
# File 'lib/archimate/data_model/organization.rb', line 34 model_attr :documentation, default: nil |
#id ⇒ String, NilClass (readonly)
Format should match /[[[:alpha:]]_]*/ to be valid for Archimate Model exchange format
23 |
# File 'lib/archimate/data_model/organization.rb', line 23 model_attr :id, default: nil |
#items ⇒ Array<Object>
37 |
# File 'lib/archimate/data_model/organization.rb', line 37 model_attr :items, writable: true, default: [], referenceable_list: true |
#name ⇒ LangString, NilClass (readonly)
LabelGroup in the XSD
27 |
# File 'lib/archimate/data_model/organization.rb', line 27 model_attr :name, default: nil |
#organizations ⇒ Array<Organization>
item in the XSD
41 |
# File 'lib/archimate/data_model/organization.rb', line 41 model_attr :organizations, writable: true, default: [], referenceable_list: true |
#type ⇒ String, NilClass (readonly)
I believe this is used only for Archi formats
31 |
# File 'lib/archimate/data_model/organization.rb', line 31 model_attr :type, default: nil |
Instance Method Details
#other_attributes ⇒ Array<AnyAttribute>
45 |
# File 'lib/archimate/data_model/organization.rb', line 45 model_attr :other_attributes, default: [] |
#other_elements ⇒ Array<AnyElement>
43 |
# File 'lib/archimate/data_model/organization.rb', line 43 model_attr :other_elements, default: [] |
#remove(id) ⇒ Object
51 52 53 |
# File 'lib/archimate/data_model/organization.rb', line 51 def remove(id) items.delete_if { |item| item.id == id } end |
#remove_reference(item) ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/archimate/data_model/organization.rb', line 55 def remove_reference(item) super case item when Organization organizations.delete(item) else items.delete(item) organizations.each { |org| org.remove_reference(item) } end end |
#replace_item_with(item, replacement) ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/archimate/data_model/organization.rb', line 66 def replace_item_with(item, replacement) case item when Organization organizations.delete(item) organizations << replacement else items.delete(item) items << replacement end end |