Class: Archimate::DataModel::Property

Inherits:
Object
  • Object
show all
Includes:
Comparison
Defined in:
lib/archimate/data_model/property.rb

Overview

A Property instance type declaring the reference to a [PropertyDefinition] and containing the property value.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Comparison

#==, #[], #dig, #each, #hash, included, #pretty_print, #to_h

Constructor Details

#initialize(property_definition:, value: nil) ⇒ Property

Returns a new instance of Property.



17
18
19
20
# File 'lib/archimate/data_model/property.rb', line 17

def initialize(property_definition:, value: nil)
  @property_definition = property_definition
  @value = value
end

Instance Attribute Details

#property_definitionPropertyDefinition

Returns property definition of the property.

Returns:



15
# File 'lib/archimate/data_model/property.rb', line 15

model_attr :property_definition, writable: true

#valueLangString, NilClass (readonly)

Returns value of the property, default nil.

Returns:

  • (LangString, NilClass)

    value of the property, default nil



12
# File 'lib/archimate/data_model/property.rb', line 12

model_attr :value

Instance Method Details

#keyObject



26
27
28
# File 'lib/archimate/data_model/property.rb', line 26

def key
  property_definition.name
end

#to_sObject



22
23
24
# File 'lib/archimate/data_model/property.rb', line 22

def to_s
  "Property(key: #{property_definition.name}, value: #{value || 'no value'})"
end