Class: Msgraph::Api::Resource::Message
- Inherits:
-
Base
- Object
- Base
- Msgraph::Api::Resource::Message
show all
- Defined in:
- lib/msgraph/api/resource/message.rb
Instance Attribute Summary
Attributes inherited from Base
#attributes, #parent, #resource_name
Instance Method Summary
collapse
Methods inherited from Base
#client, #initialize, lists, #method_missing, resource_name, #resource_path, #user
Instance Method Details
#move(parent_or_id) ⇒ Object
18
19
20
21
22
|
# File 'lib/msgraph/api/resource/message.rb', line 18
def move(parent_or_id)
id = parent_or_id
id = id.id unless id.is_a?(String)
self.attributes = post(path: resource_path.join_path("move"), body: {destination_id: id})
end
|
#read! ⇒ Object
14
15
16
|
# File 'lib/msgraph/api/resource/message.rb', line 14
def read!
self.attributes = patch(body: {is_read: true})
end
|
#read? ⇒ Boolean
6
7
8
|
# File 'lib/msgraph/api/resource/message.rb', line 6
def read?
self.is_read
end
|
#to_rfc822 ⇒ Object
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/msgraph/api/resource/message.rb', line 24
def to_rfc822
if self.attributes[:rfc822].nil?
path = user.messages.find(id).resource_path.join_path("$value")
self.attributes[:rfc822] = get(path: path, format: :plain)
end
self.attributes[:rfc822]
end
|
#unread? ⇒ Boolean
10
11
12
|
# File 'lib/msgraph/api/resource/message.rb', line 10
def unread?
!read?
end
|