Class: CiscoSpark::Message
Instance Attribute Summary collapse
-
#created ⇒ Object
Returns the value of attribute created.
-
#files ⇒ Object
Returns the value of attribute files.
-
#html ⇒ Object
Returns the value of attribute html.
-
#id ⇒ Object
Returns the value of attribute id.
-
#markdown ⇒ Object
Returns the value of attribute markdown.
-
#mentionedGroups ⇒ Object
Returns the value of attribute mentionedGroups.
-
#mentionedPeople ⇒ Object
Returns the value of attribute mentionedPeople.
-
#personEmail ⇒ Object
Returns the value of attribute personEmail.
-
#personId ⇒ Object
Returns the value of attribute personId.
-
#roomId ⇒ Object
Returns the value of attribute roomId.
-
#roomType ⇒ Object
Returns the value of attribute roomType.
-
#text ⇒ Object
Returns the value of attribute text.
-
#toPersonEmail ⇒ Object
Returns the value of attribute toPersonEmail.
-
#toPersonId ⇒ Object
Returns the value of attribute toPersonId.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Message
constructor
A new instance of Message.
Methods inherited from Base
#[], #delete, #refresh, #update
Constructor Details
#initialize(data = {}) ⇒ Message
Returns a new instance of Message.
4 5 6 7 8 |
# File 'lib/message.rb', line 4 def initialize(data = {}) @api_endpoint = 'messages' @update_fields = [] super end |
Instance Attribute Details
#created ⇒ Object
Returns the value of attribute created.
3 4 5 |
# File 'lib/message.rb', line 3 def created @created end |
#files ⇒ Object
Returns the value of attribute files.
3 4 5 |
# File 'lib/message.rb', line 3 def files @files end |
#html ⇒ Object
Returns the value of attribute html.
3 4 5 |
# File 'lib/message.rb', line 3 def html @html end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/message.rb', line 3 def id @id end |
#markdown ⇒ Object
Returns the value of attribute markdown.
3 4 5 |
# File 'lib/message.rb', line 3 def markdown @markdown end |
#mentionedGroups ⇒ Object
Returns the value of attribute mentionedGroups.
3 4 5 |
# File 'lib/message.rb', line 3 def mentionedGroups @mentionedGroups end |
#mentionedPeople ⇒ Object
Returns the value of attribute mentionedPeople.
3 4 5 |
# File 'lib/message.rb', line 3 def mentionedPeople @mentionedPeople end |
#personEmail ⇒ Object
Returns the value of attribute personEmail.
3 4 5 |
# File 'lib/message.rb', line 3 def personEmail @personEmail end |
#personId ⇒ Object
Returns the value of attribute personId.
3 4 5 |
# File 'lib/message.rb', line 3 def personId @personId end |
#roomId ⇒ Object
Returns the value of attribute roomId.
3 4 5 |
# File 'lib/message.rb', line 3 def roomId @roomId end |
#roomType ⇒ Object
Returns the value of attribute roomType.
3 4 5 |
# File 'lib/message.rb', line 3 def roomType @roomType end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/message.rb', line 3 def text @text end |
#toPersonEmail ⇒ Object
Returns the value of attribute toPersonEmail.
3 4 5 |
# File 'lib/message.rb', line 3 def toPersonEmail @toPersonEmail end |
#toPersonId ⇒ Object
Returns the value of attribute toPersonId.
3 4 5 |
# File 'lib/message.rb', line 3 def toPersonId @toPersonId end |
Class Method Details
.create(payload = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/message.rb', line 19 def create(payload = {}) # TODO: uploading attachments is a special case https://developer.ciscospark.com/attachments.html # TODO: we need some way to check that either a roomID, toPersonID or toPersonEmail was passed res = CiscoSpark.rest('POST', '/messages', payload: payload) if res.ok = CiscoSpark::Message.new(JSON.parse(res.body)) return end nil end |
.get(id) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/message.rb', line 10 def get(id) res = CiscoSpark.rest('GET', "/messages/#{id}") if res.ok = CiscoSpark::Message.new(JSON.parse(res.body)) return end nil end |