Class: Spark::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.



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

#bodyObject

Returns the value of attribute body.



104
105
106
# File 'lib/cisco-spark-ruby.rb', line 104

def body
  @body
end

#codeObject

Returns the value of attribute code.



103
104
105
# File 'lib/cisco-spark-ruby.rb', line 103

def code
  @code
end

#objectObject

Returns the value of attribute object.



105
106
107
# File 'lib/cisco-spark-ruby.rb', line 105

def object
  @object
end

Instance Method Details

#okObject



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

def ok
    return true if code < 400
    false
end

#to_sObject



111
112
113
# File 'lib/cisco-spark-ruby.rb', line 111

def to_s
    return body
end