Class: DTK::State::ComponentDef

Inherits:
Object
  • Object
show all
Defined in:
lib/state/component_def.rb,
lib/state/component_def/attribute_type_info.rb

Defined Under Namespace

Classes: AttributeTypeInfo

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace, name, content) ⇒ ComponentDef

Returns a new instance of ComponentDef.



7
8
9
10
11
12
# File 'lib/state/component_def.rb', line 7

def initialize(namespace, name, content)
  @name                = name
  @namespace           = namespace
  @executable_actions  = content[:spec][:actions]
  @attribute_type_info  = AttributeTypeInfo.create_from_kube_hash(content[:spec][:attributes] || {})
end

Instance Attribute Details

#attribute_type_infoObject (readonly)

Returns the value of attribute attribute_type_info.



5
6
7
# File 'lib/state/component_def.rb', line 5

def attribute_type_info
  @attribute_type_info
end

#executable_actionsObject (readonly)

Returns the value of attribute executable_actions.



5
6
7
# File 'lib/state/component_def.rb', line 5

def executable_actions
  @executable_actions
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/state/component_def.rb', line 5

def name
  @name
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



5
6
7
# File 'lib/state/component_def.rb', line 5

def namespace
  @namespace
end

Class Method Details

.get(namespace, name, opts = {}) ⇒ Object



14
15
16
17
# File 'lib/state/component_def.rb', line 14

def self.get(namespace, name, opts = {})
  crd_component_def = ::DTK::CrdClient.get_kubeclient(opts).get_componentdef(name, namespace)
  ComponentDef.new(namespace, name, crd_component_def)
end