Class: CiscoSpark::Room

Inherits:
Base
  • Object
show all
Defined in:
lib/room.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #delete, #refresh, #update

Constructor Details

#initialize(data) ⇒ Room

Returns a new instance of Room.



4
5
6
7
8
# File 'lib/room.rb', line 4

def initialize(data)
  @api_endpoint = 'rooms'
  @update_fields = [:title]
  super
end

Instance Attribute Details

#createdObject

Returns the value of attribute created.



3
4
5
# File 'lib/room.rb', line 3

def created
  @created
end

#creatorIdObject

Returns the value of attribute creatorId.



3
4
5
# File 'lib/room.rb', line 3

def creatorId
  @creatorId
end

#errorsObject

Returns the value of attribute errors.



3
4
5
# File 'lib/room.rb', line 3

def errors
  @errors
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/room.rb', line 3

def id
  @id
end

#isLockedObject

Returns the value of attribute isLocked.



3
4
5
# File 'lib/room.rb', line 3

def isLocked
  @isLocked
end

#lastActivityObject

Returns the value of attribute lastActivity.



3
4
5
# File 'lib/room.rb', line 3

def lastActivity
  @lastActivity
end

#sipAddressObject

Returns the value of attribute sipAddress.



3
4
5
# File 'lib/room.rb', line 3

def sipAddress
  @sipAddress
end

#teamIdObject

Returns the value of attribute teamId.



3
4
5
# File 'lib/room.rb', line 3

def teamId
  @teamId
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/room.rb', line 3

def title
  @title
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/room.rb', line 3

def type
  @type
end

Class Method Details

.create(title, payload = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/room.rb', line 20

def create(title, payload = {})
  payload[:title] = title
  res = CiscoSpark.rest('POST', '/rooms', payload: payload)
  if res.ok
    room = CiscoSpark::Room.new(JSON.parse(res.body))
    return room
  end
  nil
end

.get(id) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/room.rb', line 11

def get(id)
  res = CiscoSpark.rest('GET', "/rooms/#{id}")
  if res.ok
    room = CiscoSpark::Room.new(JSON.parse(res.body))
    return room
  end
  nil
end