Class: Reapal::Http::Response
- Inherits:
-
Object
- Object
- Reapal::Http::Response
- Defined in:
- lib/reapal/http/response.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#data_valid ⇒ Object
Returns the value of attribute data_valid.
-
#flow_id ⇒ Object
Returns the value of attribute flow_id.
-
#http_response ⇒ Object
Returns the value of attribute http_response.
-
#raw_body ⇒ Object
Returns the value of attribute raw_body.
-
#service ⇒ Object
Returns the value of attribute service.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(params) ⇒ Response
constructor
A new instance of Response.
- #to_s ⇒ Object
Constructor Details
#initialize(params) ⇒ Response
Returns a new instance of Response.
10 11 12 13 14 15 16 |
# File 'lib/reapal/http/response.rb', line 10 def initialize(params) self.data_valid = true params.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/reapal/http/response.rb', line 8 def data @data end |
#data_valid ⇒ Object
Returns the value of attribute data_valid.
8 9 10 |
# File 'lib/reapal/http/response.rb', line 8 def data_valid @data_valid end |
#flow_id ⇒ Object
Returns the value of attribute flow_id.
6 7 8 |
# File 'lib/reapal/http/response.rb', line 6 def flow_id @flow_id end |
#http_response ⇒ Object
Returns the value of attribute http_response.
7 8 9 |
# File 'lib/reapal/http/response.rb', line 7 def http_response @http_response end |
#raw_body ⇒ Object
Returns the value of attribute raw_body.
7 8 9 |
# File 'lib/reapal/http/response.rb', line 7 def raw_body @raw_body end |
#service ⇒ Object
Returns the value of attribute service.
6 7 8 |
# File 'lib/reapal/http/response.rb', line 6 def service @service end |
Instance Method Details
#[](key) ⇒ Object
18 19 20 |
# File 'lib/reapal/http/response.rb', line 18 def [] key instance_variable_get("#{key}") end |
#to_s ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/reapal/http/response.rb', line 22 def to_s arr = ["{"] self.instance_variables.map{ |value| arr << "\t#{value.to_s} => #{self[value.to_sym]}" } arr << ["}"] arr.join("\n") end |