Class: Decommas::Response::Base
- Inherits:
-
Object
- Object
- Decommas::Response::Base
- Defined in:
- lib/decommas/response/base.rb
Direct Known Subclasses
Constant Summary collapse
- VALID_RESPONSES =
[200]
- THROTTLED_RESPONSES =
[429]
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'lib/decommas/response/base.rb', line 7 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/decommas/response/base.rb', line 8 def data @data end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
9 10 11 |
# File 'lib/decommas/response/base.rb', line 9 def @message end |
Instance Method Details
#success? ⇒ Boolean
11 12 13 |
# File 'lib/decommas/response/base.rb', line 11 def success? VALID_RESPONSES.include?(@code) end |
#throttled? ⇒ Boolean
15 16 17 |
# File 'lib/decommas/response/base.rb', line 15 def throttled? THROTTLED_RESPONSES.include?(@code) end |