Class: Urifetch::Response
- Inherits:
-
Object
- Object
- Urifetch::Response
- Defined in:
- lib/urifetch/response.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#status ⇒ Object
Returns the value of attribute status.
-
#strategy_key ⇒ Object
Returns the value of attribute strategy_key.
Instance Method Summary collapse
-
#initialize(status, strategy_key, data) ⇒ Response
constructor
A new instance of Response.
- #to_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(status, strategy_key, data) ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 |
# File 'lib/urifetch/response.rb', line 7 def initialize(status,strategy_key,data) @status = status @strategy_key = strategy_key @data = data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/urifetch/response.rb', line 5 def data @data end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/urifetch/response.rb', line 5 def status @status end |
#strategy_key ⇒ Object
Returns the value of attribute strategy_key.
5 6 7 |
# File 'lib/urifetch/response.rb', line 5 def strategy_key @strategy_key end |
Instance Method Details
#to_h ⇒ Object
13 14 15 |
# File 'lib/urifetch/response.rb', line 13 def to_h @data end |
#to_json ⇒ Object
17 18 19 |
# File 'lib/urifetch/response.rb', line 17 def to_json to_h.to_json end |