Class: FipExtractor::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Response



7
8
9
10
# File 'lib/fipextractor/response.rb', line 7

def initialize(raw)
  @status = raw.status
  @all = JSON.parse(raw.body, symbolize_names: true)
end

Instance Attribute Details

#allObject (readonly)

Returns the value of attribute all.



5
6
7
# File 'lib/fipextractor/response.rb', line 5

def all
  @all
end

#statusObject (readonly)

Returns the value of attribute status.



5
6
7
# File 'lib/fipextractor/response.rb', line 5

def status
  @status
end

Instance Method Details

#error?Boolean



12
13
14
# File 'lib/fipextractor/response.rb', line 12

def error?
  status >= 400
end