Sha256: cc6dc52e55de6dac49173ee643a026edc62fab29a35cabf53e7aca9480825c6f

Contents?: true

Size: 624 Bytes

Versions: 5

Compression:

Stored size: 624 Bytes

Contents

require 'ostruct'
require 'json'
require 'forwardable'
require_relative '../../lib/check_mobi/errors/required_field_error'
require_relative '../../lib/check_mobi/client'

module CheckMobi
  class Response

    extend Forwardable

    def_delegators :@http_client, :status_code, :is_successful, :body, :response, :code
    def_delegator :response, :body, :response_body

    alias_method :reason, :body

    def initialize(http_client)
      raise RequiredFieldError, 'parameter should be a CheckMobi::Client, which is missing' unless http_client.kind_of? CheckMobi::Client
      @http_client = http_client
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
check_mobi-1.0.5 lib/check_mobi/response.rb
check_mobi-1.0.4 lib/check_mobi/response.rb
check_mobi-1.0.3 lib/check_mobi/response.rb
check_mobi-1.0.2 lib/check_mobi/response.rb
check_mobi-1.0.1 lib/check_mobi/response.rb