Class: Spark::Response
- Inherits:
-
Object
- Object
- Spark::Response
- Defined in:
- lib/cisco-spark-ruby.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
Returns the value of attribute code.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
-
#initialize(_data = {}) ⇒ Response
constructor
A new instance of Response.
- #ok ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(_data = {}) ⇒ Response
Returns a new instance of Response.
106 107 108 109 110 |
# File 'lib/cisco-spark-ruby.rb', line 106 def initialize(_data = {}) @code = _data[:code] @body = _data[:body] @object = _data[:object] end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
104 105 106 |
# File 'lib/cisco-spark-ruby.rb', line 104 def body @body end |
#code ⇒ Object
Returns the value of attribute code.
103 104 105 |
# File 'lib/cisco-spark-ruby.rb', line 103 def code @code end |
#object ⇒ Object
Returns the value of attribute object.
105 106 107 |
# File 'lib/cisco-spark-ruby.rb', line 105 def object @object end |
Instance Method Details
#ok ⇒ Object
114 115 116 117 |
# File 'lib/cisco-spark-ruby.rb', line 114 def ok return true if code < 400 false end |
#to_s ⇒ Object
111 112 113 |
# File 'lib/cisco-spark-ruby.rb', line 111 def to_s return body end |