Class: CiscoSpark::Team
Instance Attribute Summary collapse
-
#created ⇒ Object
Returns the value of attribute created.
-
#creatorId ⇒ Object
Returns the value of attribute creatorId.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Team
constructor
A new instance of Team.
Methods inherited from Base
#[], #delete, #refresh, #update
Constructor Details
#initialize(data) ⇒ Team
Returns a new instance of Team.
4 5 6 7 8 |
# File 'lib/team.rb', line 4 def initialize(data) @api_endpoint = 'teams' @update_fields = [:name] super end |
Instance Attribute Details
#created ⇒ Object
Returns the value of attribute created.
3 4 5 |
# File 'lib/team.rb', line 3 def created @created end |
#creatorId ⇒ Object
Returns the value of attribute creatorId.
3 4 5 |
# File 'lib/team.rb', line 3 def creatorId @creatorId end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/team.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/team.rb', line 3 def name @name end |
Class Method Details
.create(name, payload = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/team.rb', line 18 def create(name, payload = {}) payload[:name] = name res = CiscoSpark.rest('POST', '/teams', payload: payload) if res.ok team = CiscoSpark::Team.new(JSON.parse(res.body)) return team end nil end |
.get(id) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/team.rb', line 10 def get(id) res = CiscoSpark.rest('GET', "/teams/#{id}") if res.ok team = CiscoSpark::Team.new(JSON.parse(res.body)) return team end nil end |