Class: Legion::Extensions::Llm::ErrorMiddleware::ResponseWithBody

Inherits:
Struct
  • Object
show all
Defined in:
lib/legion/extensions/llm/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



157
158
159
160
161
# File 'lib/legion/extensions/llm/error.rb', line 157

def method_missing(method_name, ...)
  return response.public_send(method_name, ...) if response.respond_to?(method_name)

  super
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



150
151
152
# File 'lib/legion/extensions/llm/error.rb', line 150

def body
  @body
end

#responseObject

Returns the value of attribute response

Returns:

  • (Object)

    the current value of response



150
151
152
# File 'lib/legion/extensions/llm/error.rb', line 150

def response
  @response
end

Instance Method Details

#[](key) ⇒ Object



153
154
155
# File 'lib/legion/extensions/llm/error.rb', line 153

def [](key)
  response[key] if response.respond_to?(:[])
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


163
164
165
# File 'lib/legion/extensions/llm/error.rb', line 163

def respond_to_missing?(method_name, include_private = false)
  response.respond_to?(method_name, include_private) || super
end

#statusObject



151
# File 'lib/legion/extensions/llm/error.rb', line 151

def status = response.status