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



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

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



146
147
148
# File 'lib/legion/extensions/llm/error.rb', line 146

def body
  @body
end

#responseObject

Returns the value of attribute response

Returns:

  • (Object)

    the current value of response



146
147
148
# File 'lib/legion/extensions/llm/error.rb', line 146

def response
  @response
end

Instance Method Details

#[](key) ⇒ Object



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

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

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

Returns:

  • (Boolean)


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

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

#statusObject



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

def status = response.status