Class: Bizowie::API::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/bizowie/api/response.rb

Overview

Response returned by #call.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, success:) ⇒ Response

Returns a new instance of Response.



13
14
15
16
# File 'lib/bizowie/api/response.rb', line 13

def initialize(data:, success:)
  @data = data
  @success = success
end

Instance Attribute Details

#dataHash (readonly)

Returns Decoded JSON response body (with success removed). { ‘unprocessed’ => 1 } if the body could not be parsed.

Returns:

  • (Hash)

    Decoded JSON response body (with success removed). { ‘unprocessed’ => 1 } if the body could not be parsed.



10
11
12
13
14
15
16
17
# File 'lib/bizowie/api/response.rb', line 10

class Response
  attr_reader :data, :success

  def initialize(data:, success:)
    @data = data
    @success = success
  end
end

#successInteger (readonly)

Returns 1 on success, 0 otherwise.

Returns:

  • (Integer)

    1 on success, 0 otherwise.



10
11
12
13
14
15
16
17
# File 'lib/bizowie/api/response.rb', line 10

class Response
  attr_reader :data, :success

  def initialize(data:, success:)
    @data = data
    @success = success
  end
end