class DTK::State::WorkflowInstance::AttributeTypeInfo

Attributes

dynamic[R]
encrypted[R]
name[R]
required[R]
temporal[R]
type[R]
value[R]

Public Class Methods

create_from_kube_hash(kube_attributes) click to toggle source
# 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
new(name, params) click to toggle source
# 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

Public Instance Methods

to_hash() click to toggle source
# 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