Class: CiscoSpark::Response
- Inherits:
-
Object
- Object
- CiscoSpark::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.
119 120 121 122 123 |
# File 'lib/cisco-spark-ruby.rb', line 119 def initialize(data = {}) @code = data[:code] @body = data[:body] @object = data[:object] end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
117 118 119 |
# File 'lib/cisco-spark-ruby.rb', line 117 def body @body end |
#code ⇒ Object
Returns the value of attribute code.
116 117 118 |
# File 'lib/cisco-spark-ruby.rb', line 116 def code @code end |
#object ⇒ Object
Returns the value of attribute object.
118 119 120 |
# File 'lib/cisco-spark-ruby.rb', line 118 def object @object end |
Instance Method Details
#ok ⇒ Object
129 130 131 132 |
# File 'lib/cisco-spark-ruby.rb', line 129 def ok return true if code < 400 false end |
#to_s ⇒ Object
125 126 127 |
# File 'lib/cisco-spark-ruby.rb', line 125 def to_s body end |