Class: Rushover::Response
- Inherits:
-
Object
- Object
- Rushover::Response
- Defined in:
- lib/rushover.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(data) ⇒ Response
constructor
A new instance of Response.
- #inspect ⇒ Object
- #ok? ⇒ Boolean
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(data) ⇒ Response
Returns a new instance of Response.
89 90 91 |
# File 'lib/rushover.rb', line 89 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
87 88 89 |
# File 'lib/rushover.rb', line 87 def data @data end |
Instance Method Details
#[](key) ⇒ Object
93 94 95 |
# File 'lib/rushover.rb', line 93 def [](key) @data[key.to_s] end |
#inspect ⇒ Object
101 102 103 |
# File 'lib/rushover.rb', line 101 def inspect @data.inspect end |
#ok? ⇒ Boolean
97 98 99 |
# File 'lib/rushover.rb', line 97 def ok? self["status"].to_i == 1 end |
#to_h ⇒ Object
109 110 111 |
# File 'lib/rushover.rb', line 109 def to_h @data.dup end |
#to_s ⇒ Object
105 106 107 |
# File 'lib/rushover.rb', line 105 def to_s @data.to_s end |