class DTK::State::ComponentDef::AttributeTypeInfo
Attributes
dynamic[R]
encrypted[R]
name[R]
required[R]
temporal[R]
type[R]
Public Class Methods
create_from_kube_hash(kube_attributes)
click to toggle source
# File lib/state/component_def/attribute_type_info.rb, line 16 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/component_def/attribute_type_info.rb, line 7 def initialize(name, params) @name = name.to_s @type = params[:type] @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/component_def/attribute_type_info.rb, line 22 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