Class: Alula::M2MResponse
- Inherits:
-
AlulaResponse
- Object
- AlulaResponse
- Alula::M2MResponse
- Defined in:
- lib/alula/m2m_response.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#http_body ⇒ Object
Returns the value of attribute http_body.
-
#http_headers ⇒ Object
Returns the value of attribute http_headers.
-
#http_status ⇒ Object
Returns the value of attribute http_status.
-
#rate_limit ⇒ Object
Returns the value of attribute rate_limit.
-
#raw ⇒ Object
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/alula/m2m_response.rb', line 5 def data @data end |
#http_body ⇒ Object
Returns the value of attribute http_body.
5 6 7 |
# File 'lib/alula/m2m_response.rb', line 5 def http_body @http_body end |
#http_headers ⇒ Object
Returns the value of attribute http_headers.
5 6 7 |
# File 'lib/alula/m2m_response.rb', line 5 def http_headers @http_headers end |
#http_status ⇒ Object
Returns the value of attribute http_status.
5 6 7 |
# File 'lib/alula/m2m_response.rb', line 5 def http_status @http_status end |
#rate_limit ⇒ Object
Returns the value of attribute rate_limit.
5 6 7 |
# File 'lib/alula/m2m_response.rb', line 5 def rate_limit @rate_limit end |
#raw ⇒ Object
Returns the value of attribute raw.
5 6 7 |
# File 'lib/alula/m2m_response.rb', line 5 def raw @raw end |
Class Method Details
.from_httparty_response(response) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/alula/m2m_response.rb', line 11 def self.from_httparty_response(response) resp = M2MResponse.new resp.data = response.parsed_response resp.http_body = response.body resp.http_headers = response.headers resp.rate_limit = Alula::RateLimit.new(response.headers) resp.http_status = response.code resp.raw = response resp end |
Instance Method Details
#ok? ⇒ Boolean
7 8 9 |
# File 'lib/alula/m2m_response.rb', line 7 def ok? super && self.data['Success'] == true end |