Class: Ifns::Responses::Base
- Inherits:
-
Object
- Object
- Ifns::Responses::Base
show all
- Defined in:
- lib/ifns/responses/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(response) ⇒ Base
Returns a new instance of Base.
8
9
10
|
# File 'lib/ifns/responses/base.rb', line 8
def initialize(response)
@response = response
end
|
Instance Attribute Details
#cached ⇒ Object
Returns the value of attribute cached.
4
5
6
|
# File 'lib/ifns/responses/base.rb', line 4
def cached
@cached
end
|
#id ⇒ Object
Returns the value of attribute id.
4
5
6
|
# File 'lib/ifns/responses/base.rb', line 4
def id
@id
end
|
#response ⇒ Object
Returns the value of attribute response.
4
5
6
|
# File 'lib/ifns/responses/base.rb', line 4
def response
@response
end
|
Instance Method Details
#accepted? ⇒ Boolean
40
41
42
|
# File 'lib/ifns/responses/base.rb', line 40
def accepted?
status == 202
end
|
#gone? ⇒ Boolean
28
29
30
|
# File 'lib/ifns/responses/base.rb', line 28
def gone?
status == 410
end
|
#good? ⇒ Boolean
24
25
26
|
# File 'lib/ifns/responses/base.rb', line 24
def good?
status == 200
end
|
#incorrect_fpd? ⇒ Boolean
52
53
54
|
# File 'lib/ifns/responses/base.rb', line 52
def incorrect_fpd?
status == 406
end
|
#incorrect_params? ⇒ Boolean
44
45
46
|
# File 'lib/ifns/responses/base.rb', line 44
def incorrect_params?
status == 400
end
|
#internal_error? ⇒ Boolean
32
33
34
|
# File 'lib/ifns/responses/base.rb', line 32
def internal_error?
status >= 500
end
|
#invalid? ⇒ Boolean
16
17
18
|
# File 'lib/ifns/responses/base.rb', line 16
def invalid?
incorrect_fpd? || incorrect_params?
end
|
#not_found? ⇒ Boolean
36
37
38
|
# File 'lib/ifns/responses/base.rb', line 36
def not_found?
status == 404
end
|
#rate_limit_exceeded? ⇒ Boolean
48
49
50
|
# File 'lib/ifns/responses/base.rb', line 48
def rate_limit_exceeded?
status == 429
end
|
#retry? ⇒ Boolean
20
21
22
|
# File 'lib/ifns/responses/base.rb', line 20
def retry?
gone? || accepted? || not_found?
end
|
#valid? ⇒ Boolean
12
13
14
|
# File 'lib/ifns/responses/base.rb', line 12
def valid?
good?
end
|