Class: VatInfo::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code:, body: {}, raw: {}) ⇒ Response

Returns a new instance of Response.



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

def initialize(status_code:, body: {}, raw: {})
  @status_code = status_code
  @body        = body
  @raw         = raw
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/vat_info/response.rb', line 3

def body
  @body
end

#rawObject

Returns the value of attribute raw.



3
4
5
# File 'lib/vat_info/response.rb', line 3

def raw
  @raw
end

#status_codeObject

Returns the value of attribute status_code.



3
4
5
# File 'lib/vat_info/response.rb', line 3

def status_code
  @status_code
end

Instance Method Details

#ok?Boolean

Returns:

  • (Boolean)


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

def ok?
  status_code == 200
end