Class: Cadenya::Types::CompactObjectiveResponse

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(context_window: nil) ⇒ CompactObjectiveResponse

Returns a new instance of CompactObjectiveResponse.



1192
1193
1194
# File 'lib/cadenya/types.rb', line 1192

def initialize(context_window: nil)
  @context_window = context_window
end

Instance Attribute Details

#context_windowObject (readonly)

Returns the value of attribute context_window.



1190
1191
1192
# File 'lib/cadenya/types.rb', line 1190

def context_window
  @context_window
end

Class Method Details

.from_json(data) ⇒ Object



1196
1197
1198
1199
1200
# File 'lib/cadenya/types.rb', line 1196

def self.from_json(data)
  new(
    context_window: data["contextWindow"].nil? ? nil : Types::ObjectiveContextWindowData.from_json(data["contextWindow"]),
  )
end

Instance Method Details

#to_hObject



1202
1203
1204
1205
1206
# File 'lib/cadenya/types.rb', line 1202

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