Class: Zm::Client::Message::Attachment
- Inherits:
-
Object
- Object
- Zm::Client::Message::Attachment
- Defined in:
- lib/zm/client/message/message.rb
Overview
class attachment for email
Instance Attribute Summary collapse
-
#aid ⇒ Object
Returns the value of attribute aid.
-
#cd ⇒ Object
Returns the value of attribute cd.
-
#ci ⇒ Object
Returns the value of attribute ci.
-
#ct ⇒ Object
Returns the value of attribute ct.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#mid ⇒ Object
Returns the value of attribute mid.
-
#part ⇒ Object
Returns the value of attribute part.
-
#s ⇒ Object
Returns the value of attribute s.
Instance Method Summary collapse
- #account ⇒ Object
- #download(dest_file_path) ⇒ Object
-
#initialize(parent) {|_self| ... } ⇒ Attachment
constructor
A new instance of Attachment.
- #to_jsns ⇒ Object
Constructor Details
#initialize(parent) {|_self| ... } ⇒ Attachment
Returns a new instance of Attachment.
211 212 213 214 |
# File 'lib/zm/client/message/message.rb', line 211 def initialize(parent) @parent = parent yield(self) if block_given? end |
Instance Attribute Details
#aid ⇒ Object
Returns the value of attribute aid.
209 210 211 |
# File 'lib/zm/client/message/message.rb', line 209 def aid @aid end |
#cd ⇒ Object
Returns the value of attribute cd.
209 210 211 |
# File 'lib/zm/client/message/message.rb', line 209 def cd @cd end |
#ci ⇒ Object
Returns the value of attribute ci.
209 210 211 |
# File 'lib/zm/client/message/message.rb', line 209 def ci @ci end |
#ct ⇒ Object
Returns the value of attribute ct.
209 210 211 |
# File 'lib/zm/client/message/message.rb', line 209 def ct @ct end |
#filename ⇒ Object
Returns the value of attribute filename.
209 210 211 |
# File 'lib/zm/client/message/message.rb', line 209 def filename @filename end |
#mid ⇒ Object
Returns the value of attribute mid.
209 210 211 |
# File 'lib/zm/client/message/message.rb', line 209 def mid @mid end |
#part ⇒ Object
Returns the value of attribute part.
209 210 211 |
# File 'lib/zm/client/message/message.rb', line 209 def part @part end |
#s ⇒ Object
Returns the value of attribute s.
209 210 211 |
# File 'lib/zm/client/message/message.rb', line 209 def s @s end |
Instance Method Details
#account ⇒ Object
248 249 250 |
# File 'lib/zm/client/message/message.rb', line 248 def account @parent.parent end |
#download(dest_file_path) ⇒ Object
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/zm/client/message/message.rb', line 216 def download(dest_file_path) h = { id: @parent.id, part: part, auth: 'qp', zauthtoken: account.token, disp: 'a' } url = account.home_url uri = Addressable::URI.new uri.query_values = h url << '?' << uri.query uploader = Upload.new(@parent, RestAccountConnector.new) uploader.download_file_with_url(url, dest_file_path) end |
#to_jsns ⇒ Object
235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/zm/client/message/message.rb', line 235 def to_jsns { part: part, mid: mid, aid: aid, ct: ct, s: s, filename: filename, ci: ci, cd: cd }.reject { |_, v| v.nil? } end |