Class: Cadenya::Types::ObjectiveEventData_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) ⇒ ObjectiveEventData_Reasoning

Returns a new instance of ObjectiveEventData_Reasoning.



8941
8942
8943
8944
# File 'lib/cadenya/types.rb', line 8941

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

Instance Attribute Details

#reasoningObject (readonly)

Returns the value of attribute reasoning.



8939
8940
8941
# File 'lib/cadenya/types.rb', line 8939

def reasoning
  @reasoning
end

#typeObject (readonly)

Returns the value of attribute type.



8939
8940
8941
# File 'lib/cadenya/types.rb', line 8939

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8946
8947
8948
8949
8950
8951
# File 'lib/cadenya/types.rb', line 8946

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

Instance Method Details

#to_hObject



8953
8954
8955
8956
8957
8958
# File 'lib/cadenya/types.rb', line 8953

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