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



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

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



148
149
150
# File 'lib/legion/extensions/llm/error.rb', line 148

def body
  @body
end

#responseObject

Returns the value of attribute response

Returns:

  • (Object)

    the current value of response



148
149
150
# File 'lib/legion/extensions/llm/error.rb', line 148

def response
  @response
end

Instance Method Details

#[](key) ⇒ Object



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

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

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

Returns:

  • (Boolean)


161
162
163
# File 'lib/legion/extensions/llm/error.rb', line 161

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

#statusObject



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

def status = response.status