Class: Cadenya::Types::AgentVariation

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata: nil, spec: nil, info: nil) ⇒ AgentVariation

Returns a new instance of AgentVariation.



612
613
614
615
616
# File 'lib/cadenya/types.rb', line 612

def initialize(metadata: nil, spec: nil, info: nil)
  @metadata = 
  @spec = spec
  @info = info
end

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



610
611
612
# File 'lib/cadenya/types.rb', line 610

def info
  @info
end

#metadataObject (readonly)

Returns the value of attribute metadata.



610
611
612
# File 'lib/cadenya/types.rb', line 610

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



610
611
612
# File 'lib/cadenya/types.rb', line 610

def spec
  @spec
end

Class Method Details

.from_json(data) ⇒ Object



618
619
620
621
622
623
624
# File 'lib/cadenya/types.rb', line 618

def self.from_json(data)
  new(
    metadata: data["metadata"].nil? ? nil : Types::ResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::AgentVariationSpec.from_json(data["spec"]),
    info: data["info"].nil? ? nil : Types::AgentVariationInfo.from_json(data["info"]),
  )
end

Instance Method Details

#to_hObject



626
627
628
629
630
631
632
# File 'lib/cadenya/types.rb', line 626

def to_h
  {
    metadata: Util.plain(@metadata),
    spec: Util.plain(@spec),
    info: Util.plain(@info),
  }.reject { |_k, v| v.nil? }
end