Class: Cadenya::Types::ObjectiveFeedbackInfo

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(submitted_by: nil, objective: nil, agent_variation: nil) ⇒ ObjectiveFeedbackInfo

Returns a new instance of ObjectiveFeedbackInfo.



3896
3897
3898
3899
3900
# File 'lib/cadenya/types.rb', line 3896

def initialize(submitted_by: nil, objective: nil, agent_variation: nil)
  @submitted_by = 
  @objective = objective
  @agent_variation = agent_variation
end

Instance Attribute Details

#agent_variationObject (readonly)

Returns the value of attribute agent_variation.



3894
3895
3896
# File 'lib/cadenya/types.rb', line 3894

def agent_variation
  @agent_variation
end

#objectiveObject (readonly)

Returns the value of attribute objective.



3894
3895
3896
# File 'lib/cadenya/types.rb', line 3894

def objective
  @objective
end

#submitted_byObject (readonly)

Returns the value of attribute submitted_by.



3894
3895
3896
# File 'lib/cadenya/types.rb', line 3894

def 
  @submitted_by
end

Class Method Details

.from_json(data) ⇒ Object



3902
3903
3904
3905
3906
3907
3908
# File 'lib/cadenya/types.rb', line 3902

def self.from_json(data)
  new(
    submitted_by: data["submittedBy"].nil? ? nil : Types::Profile.from_json(data["submittedBy"]),
    objective: data["objective"].nil? ? nil : Types::BareMetadata.from_json(data["objective"]),
    agent_variation: data["agentVariation"].nil? ? nil : Types::BareMetadata.from_json(data["agentVariation"]),
  )
end

Instance Method Details

#to_hObject



3910
3911
3912
3913
3914
3915
3916
# File 'lib/cadenya/types.rb', line 3910

def to_h
  {
    submitted_by: Util.plain(@submitted_by),
    objective: Util.plain(@objective),
    agent_variation: Util.plain(@agent_variation),
  }.reject { |_k, v| v.nil? }
end