Class: SimpleResponse::Response

Inherits:
SimpleStruct show all
Defined in:
lib/simple_response/response.rb

Instance Method Summary collapse

Methods inherited from SimpleStruct

#keys

Methods included from QueryMethods

#existing_query_method?

Constructor Details

#initialize(success:, **attributes) ⇒ Response

Returns a new instance of Response.



6
7
8
9
# File 'lib/simple_response/response.rb', line 6

def initialize(success:, **attributes)
  super(attributes)
  @success = success
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class SimpleResponse::SimpleStruct

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/simple_response/response.rb', line 15

def failure?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/simple_response/response.rb', line 11

def success?
  @success
end