Class: Cadenya::Types::ModelSpec_Capability_Reasoning

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(type: nil, reasoning: nil) ⇒ ModelSpec_Capability_Reasoning

Returns a new instance of ModelSpec_Capability_Reasoning.



9486
9487
9488
9489
# File 'lib/cadenya/types.rb', line 9486

def initialize(type: nil, reasoning: nil)
  @type = type
  @reasoning = reasoning
end

Instance Attribute Details

#reasoningObject (readonly)

Returns the value of attribute reasoning.



9484
9485
9486
# File 'lib/cadenya/types.rb', line 9484

def reasoning
  @reasoning
end

#typeObject (readonly)

Returns the value of attribute type.



9484
9485
9486
# File 'lib/cadenya/types.rb', line 9484

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9491
9492
9493
9494
9495
9496
# File 'lib/cadenya/types.rb', line 9491

def self.from_json(data)
  new(
    type: data["type"],
    reasoning: data["reasoning"].nil? ? nil : Types::Capability_Reasoning.from_json(data["reasoning"]),
  )
end

Instance Method Details

#to_hObject



9498
9499
9500
9501
9502
9503
# File 'lib/cadenya/types.rb', line 9498

def to_h
  {
    type: Util.plain(@type),
    reasoning: Util.plain(@reasoning),
  }.reject { |_k, v| v.nil? }
end