Class: Cadenya::Types::ObjectiveEventData_SubAgentSpawned

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, sub_agent_spawned: nil) ⇒ ObjectiveEventData_SubAgentSpawned

Returns a new instance of ObjectiveEventData_SubAgentSpawned.



8826
8827
8828
8829
# File 'lib/cadenya/types.rb', line 8826

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

Instance Attribute Details

#sub_agent_spawnedObject (readonly)

Returns the value of attribute sub_agent_spawned.



8824
8825
8826
# File 'lib/cadenya/types.rb', line 8824

def sub_agent_spawned
  @sub_agent_spawned
end

#typeObject (readonly)

Returns the value of attribute type.



8824
8825
8826
# File 'lib/cadenya/types.rb', line 8824

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8831
8832
8833
8834
8835
8836
# File 'lib/cadenya/types.rb', line 8831

def self.from_json(data)
  new(
    type: data["type"],
    sub_agent_spawned: data["subAgentSpawned"].nil? ? nil : Types::SubAgentSpawned.from_json(data["subAgentSpawned"]),
  )
end

Instance Method Details

#to_hObject



8838
8839
8840
8841
8842
8843
# File 'lib/cadenya/types.rb', line 8838

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