Class: Archimate::DataModel::Property
- Inherits:
-
Object
- Object
- Archimate::DataModel::Property
- 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
-
#property_definition ⇒ PropertyDefinition
Property definition of the property.
-
#value ⇒ LangString, NilClass
readonly
Value of the property, default
nil
.
Instance Method Summary collapse
-
#initialize(property_definition:, value: nil) ⇒ Property
constructor
A new instance of Property.
- #key ⇒ Object
- #to_s ⇒ Object
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_definition ⇒ PropertyDefinition
Returns property definition of the property.
15 |
# File 'lib/archimate/data_model/property.rb', line 15 model_attr :property_definition, writable: true |
#value ⇒ LangString, NilClass (readonly)
Returns value of the property, default nil
.
12 |
# File 'lib/archimate/data_model/property.rb', line 12 model_attr :value |
Instance Method Details
#key ⇒ Object
26 27 28 |
# File 'lib/archimate/data_model/property.rb', line 26 def key property_definition.name end |
#to_s ⇒ Object
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 |