Class: DTK::State::WorkflowInstance::AttributeTypeInfo
- Inherits:
-
Object
- Object
- DTK::State::WorkflowInstance::AttributeTypeInfo
- Defined in:
- lib/state/workflow_instance/attribute_type_info.rb
Instance Attribute Summary collapse
-
#dynamic ⇒ Object
readonly
Returns the value of attribute dynamic.
-
#encrypted ⇒ Object
readonly
Returns the value of attribute encrypted.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#temporal ⇒ Object
readonly
Returns the value of attribute temporal.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, params) ⇒ AttributeTypeInfo
constructor
A new instance of AttributeTypeInfo.
- #to_hash ⇒ Object
Constructor Details
#initialize(name, params) ⇒ AttributeTypeInfo
Returns a new instance of AttributeTypeInfo.
8 9 10 11 12 13 14 15 16 |
# File 'lib/state/workflow_instance/attribute_type_info.rb', line 8 def initialize(name, params) @name = name.to_s @type = params[:type] @value = params[:value] || nil @required = params[:required] || false @dynamic = params[:dynamic] || false @temporal = params[:temporal] || false @encrypted = params[:encrypted] || false end |
Instance Attribute Details
#dynamic ⇒ Object (readonly)
Returns the value of attribute dynamic.
6 7 8 |
# File 'lib/state/workflow_instance/attribute_type_info.rb', line 6 def dynamic @dynamic end |
#encrypted ⇒ Object (readonly)
Returns the value of attribute encrypted.
6 7 8 |
# File 'lib/state/workflow_instance/attribute_type_info.rb', line 6 def encrypted @encrypted end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/state/workflow_instance/attribute_type_info.rb', line 6 def name @name end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
6 7 8 |
# File 'lib/state/workflow_instance/attribute_type_info.rb', line 6 def required @required end |
#temporal ⇒ Object (readonly)
Returns the value of attribute temporal.
6 7 8 |
# File 'lib/state/workflow_instance/attribute_type_info.rb', line 6 def temporal @temporal end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/state/workflow_instance/attribute_type_info.rb', line 6 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/state/workflow_instance/attribute_type_info.rb', line 6 def value @value end |
Class Method Details
.create_from_kube_hash(kube_attributes) ⇒ Object
18 19 20 21 22 |
# File 'lib/state/workflow_instance/attribute_type_info.rb', line 18 def self.create_from_kube_hash(kube_attributes) kube_attributes.to_hash.map do |attribute_name, attribute_content| AttributeTypeInfo.new(attribute_name, attribute_content) end end |
Instance Method Details
#to_hash ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/state/workflow_instance/attribute_type_info.rb', line 24 def to_hash type_info = {} type_info.merge!(name: @name) if @name type_info.merge!(type: @type) if @type type_info.merge!(required: @required) if @required type_info.merge!(dynamic: @dynamic) if @dynamic type_info.merge!(temporal: @temporal) if @temporal type_info.merge!(encrypted: @encrypted) if @encrypted type_info end |