Class: Cadenya::Types::ObjectiveEventData_ContextWindowCompacted

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, context_window_compacted: nil) ⇒ ObjectiveEventData_ContextWindowCompacted

Returns a new instance of ObjectiveEventData_ContextWindowCompacted.



8757
8758
8759
8760
# File 'lib/cadenya/types.rb', line 8757

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

Instance Attribute Details

#context_window_compactedObject (readonly)

Returns the value of attribute context_window_compacted.



8755
8756
8757
# File 'lib/cadenya/types.rb', line 8755

def context_window_compacted
  @context_window_compacted
end

#typeObject (readonly)

Returns the value of attribute type.



8755
8756
8757
# File 'lib/cadenya/types.rb', line 8755

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8762
8763
8764
8765
8766
8767
# File 'lib/cadenya/types.rb', line 8762

def self.from_json(data)
  new(
    type: data["type"],
    context_window_compacted: data["contextWindowCompacted"].nil? ? nil : Types::ContextWindowCompacted.from_json(data["contextWindowCompacted"]),
  )
end

Instance Method Details

#to_hObject



8769
8770
8771
8772
8773
8774
# File 'lib/cadenya/types.rb', line 8769

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