Class: CiscoSpark::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/cisco-spark-ruby.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject

Returns the value of attribute body.



117
118
119
# File 'lib/cisco-spark-ruby.rb', line 117

def body
  @body
end

#codeObject

Returns the value of attribute code.



116
117
118
# File 'lib/cisco-spark-ruby.rb', line 116

def code
  @code
end

#objectObject

Returns the value of attribute object.



118
119
120
# File 'lib/cisco-spark-ruby.rb', line 118

def object
  @object
end

Instance Method Details

#okObject



129
130
131
132
# File 'lib/cisco-spark-ruby.rb', line 129

def ok
  return true if code < 400
  false
end

#to_sObject



125
126
127
# File 'lib/cisco-spark-ruby.rb', line 125

def to_s
  body
end