Class: Roseflow::StabilityAI::ResponseHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/roseflow/stabilityai/response_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(operation, response) ⇒ ResponseHandler

Returns a new instance of ResponseHandler.



12
13
14
15
# File 'lib/roseflow/stabilityai/response_handler.rb', line 12

def initialize(operation, response)
  @operation = operation
  @response = response
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
# File 'lib/roseflow/stabilityai/response_handler.rb', line 17

def call
  if response.success?
    handle_successful_response
  else
    handle_error_response
  end
end