Class: Zm::Client::Message
- Inherits:
-
Base::Object
- Object
- Base::Object
- Zm::Client::Message
- Includes:
- BelongsToFolder, BelongsToTag
- Defined in:
- lib/zm/client/message/message.rb,
lib/zm/client/message/message_flags.rb,
lib/zm/client/message/message_recipients.rb,
lib/zm/client/message/attachments_collection.rb
Overview
class message for account
Defined Under Namespace
Classes: Attachment, AttachmentsCollection, Body, FlagsCollection, Recipient, Recipients
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#autoSendTime ⇒ Object
Returns the value of attribute autoSendTime.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#d ⇒ Object
Returns the value of attribute d.
-
#f ⇒ Object
Returns the value of attribute f.
-
#fr ⇒ Object
Returns the value of attribute fr.
-
#id ⇒ Object
Returns the value of attribute id.
-
#idnt ⇒ Object
Returns the value of attribute idnt.
-
#l ⇒ Object
Returns the value of attribute l.
-
#mid ⇒ Object
Returns the value of attribute mid.
-
#recipients ⇒ Object
readonly
Returns the value of attribute recipients.
-
#su ⇒ Object
Returns the value of attribute su.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#tn ⇒ Object
Returns the value of attribute tn.
Attributes inherited from Base::Object
Instance Method Summary collapse
- #create!(*args) ⇒ Object
- #date ⇒ Object
- #delete! ⇒ Object
- #download(dest_file_path, fmt = 'eml') ⇒ Object
- #flags ⇒ Object
-
#initialize(parent) {|_self| ... } ⇒ Message
constructor
A new instance of Message.
- #jsns_builder ⇒ Object
- #modify!(*args) ⇒ Object
- #rename!(*args) ⇒ Object
- #sacc ⇒ Object
- #send! ⇒ Object
- #spam! ⇒ Object
- #unspam! ⇒ Object
- #update!(*args) ⇒ Object
Methods included from BelongsToTag
Methods included from BelongsToFolder
#folder, #folder!, #folder=, #folder_id, #move!, #trash!
Methods inherited from Base::Object
#clone, #inspect, #instance_variables_map, #logger, #recorded?, #save!, #to_h, #to_s, #update_attribute
Constructor Details
#initialize(parent) {|_self| ... } ⇒ Message
Returns a new instance of Message.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/zm/client/message/message.rb', line 13 def initialize(parent) @parent = parent @subject = '' @recipients = Recipients.new @body = Body.new @attachments = AttachmentsCollection.new yield(self) if block_given? end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
11 12 13 |
# File 'lib/zm/client/message/message.rb', line 11 def @attachments end |
#autoSendTime ⇒ Object
Returns the value of attribute autoSendTime.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def autoSendTime @autoSendTime end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
11 12 13 |
# File 'lib/zm/client/message/message.rb', line 11 def body @body end |
#d ⇒ Object
Returns the value of attribute d.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def d @d end |
#f ⇒ Object
Returns the value of attribute f.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def f @f end |
#fr ⇒ Object
Returns the value of attribute fr.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def fr @fr end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def id @id end |
#idnt ⇒ Object
Returns the value of attribute idnt.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def idnt @idnt end |
#l ⇒ Object
Returns the value of attribute l.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def l @l end |
#mid ⇒ Object
Returns the value of attribute mid.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def mid @mid end |
#recipients ⇒ Object (readonly)
Returns the value of attribute recipients.
11 12 13 |
# File 'lib/zm/client/message/message.rb', line 11 def recipients @recipients end |
#su ⇒ Object
Returns the value of attribute su.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def su @su end |
#subject ⇒ Object
Returns the value of attribute subject.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def subject @subject end |
#tn ⇒ Object
Returns the value of attribute tn.
10 11 12 |
# File 'lib/zm/client/message/message.rb', line 10 def tn @tn end |
Instance Method Details
#create!(*args) ⇒ Object
37 38 39 |
# File 'lib/zm/client/message/message.rb', line 37 def create!(*args) raise NotImplementedError end |
#date ⇒ Object
29 30 31 |
# File 'lib/zm/client/message/message.rb', line 29 def date @date ||= Time.at(d.to_i / 1000) end |
#delete! ⇒ Object
53 54 55 56 57 58 |
# File 'lib/zm/client/message/message.rb', line 53 def delete! return false if @id.nil? @parent.sacc.invoke(jsns_builder.to_delete) @id = nil end |
#download(dest_file_path, fmt = 'eml') ⇒ Object
24 25 26 27 |
# File 'lib/zm/client/message/message.rb', line 24 def download(dest_file_path, fmt = 'eml') uploader = Upload.new(@parent, RestAccountConnector.new) uploader.download_file( Zm::Client::FolderDefault::ROOT[:path], fmt, [Zm::Client::FolderView::MESSAGE], [@id], dest_file_path) end |
#flags ⇒ Object
33 34 35 |
# File 'lib/zm/client/message/message.rb', line 33 def flags @flags ||= FlagsCollection.new(self) end |
#jsns_builder ⇒ Object
82 83 84 |
# File 'lib/zm/client/message/message.rb', line 82 def jsns_builder @jsns_builder ||= MessageJsnsBuilder.new(self) end |
#modify!(*args) ⇒ Object
41 42 43 |
# File 'lib/zm/client/message/message.rb', line 41 def modify!(*args) raise NotImplementedError end |
#rename!(*args) ⇒ Object
49 50 51 |
# File 'lib/zm/client/message/message.rb', line 49 def rename!(*args) raise NotImplementedError end |
#sacc ⇒ Object
78 79 80 |
# File 'lib/zm/client/message/message.rb', line 78 def sacc @parent.sacc end |
#send! ⇒ Object
68 69 70 71 |
# File 'lib/zm/client/message/message.rb', line 68 def send! soap_request = SoapElement.mail(SoapMailConstants::SEND_MSG_REQUEST).add_attributes(jsns_builder.to_jsns) @parent.sacc.invoke(soap_request) end |
#spam! ⇒ Object
64 65 66 |
# File 'lib/zm/client/message/message.rb', line 64 def spam! @parent.sacc.invoke(jsns_builder.to_spam) end |
#unspam! ⇒ Object
60 61 62 |
# File 'lib/zm/client/message/message.rb', line 60 def unspam! @parent.sacc.invoke(jsns_builder.to_unspam) end |
#update!(*args) ⇒ Object
45 46 47 |
# File 'lib/zm/client/message/message.rb', line 45 def update!(*args) raise NotImplementedError end |