Class: Dropio::Asset
Instance Attribute Summary collapse
-
#artist ⇒ Object
Returns the value of attribute artist.
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#converted ⇒ Object
Returns the value of attribute converted.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#drop ⇒ Object
Returns the value of attribute drop.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#file ⇒ Object
Returns the value of attribute file.
-
#filesize ⇒ Object
Returns the value of attribute filesize.
-
#height ⇒ Object
Returns the value of attribute height.
-
#hidden_url ⇒ Object
Returns the value of attribute hidden_url.
-
#name ⇒ Object
Returns the value of attribute name.
-
#pages ⇒ Object
Returns the value of attribute pages.
-
#status ⇒ Object
Returns the value of attribute status.
-
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
-
#title ⇒ Object
Returns the value of attribute title.
-
#track_title ⇒ Object
Returns the value of attribute track_title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#comments ⇒ Object
Returns the comments on this asset.
-
#create_comment(contents) ⇒ Object
Adds a comment to the asset with the given
contents
. -
#destroy! ⇒ Object
Destroys the asset on drop.io.
-
#faxable? ⇒ Boolean
Returns true if the Asset can be faxed.
-
#generate_url ⇒ Object
Generates an authenticated URL that will bypass any login action.
-
#save ⇒ Object
Saves the asset back to drop.io.
-
#send_to_drop(drop_name) ⇒ Object
Sends the asset to a Drop by
drop_name
. -
#send_to_emails(emails = [], message = nil) ⇒ Object
Sends the asset to the given
emails
with an optionalmessage
. -
#send_to_fax(fax_number) ⇒ Object
Fax the asset to the given
fax_number
.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Dropio::Resource
Instance Attribute Details
#artist ⇒ Object
Returns the value of attribute artist.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def artist @artist end |
#contents ⇒ Object
Returns the value of attribute contents.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def contents @contents end |
#converted ⇒ Object
Returns the value of attribute converted.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def converted @converted end |
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def description @description end |
#drop ⇒ Object
Returns the value of attribute drop.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def drop @drop end |
#duration ⇒ Object
Returns the value of attribute duration.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def duration @duration end |
#file ⇒ Object
Returns the value of attribute file.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def file @file end |
#filesize ⇒ Object
Returns the value of attribute filesize.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def filesize @filesize end |
#height ⇒ Object
Returns the value of attribute height.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def height @height end |
#hidden_url ⇒ Object
Returns the value of attribute hidden_url.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def hidden_url @hidden_url end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def name @name end |
#pages ⇒ Object
Returns the value of attribute pages.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def pages @pages end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def status @status end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def thumbnail @thumbnail end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def title @title end |
#track_title ⇒ Object
Returns the value of attribute track_title.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def track_title @track_title end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def url @url end |
#width ⇒ Object
Returns the value of attribute width.
3 4 5 |
# File 'lib/dropio/asset.rb', line 3 def width @width end |
Instance Method Details
#comments ⇒ Object
Returns the comments on this asset. Comments are loaded lazily. The first call to comments
will fetch the comments from the server. They are then cached until the asset is reloaded.
10 11 12 13 |
# File 'lib/dropio/asset.rb', line 10 def comments @comments = Dropio::Client.instance.find_comments(self) if @comments.nil? @comments ||= [] end |
#create_comment(contents) ⇒ Object
Adds a comment to the asset with the given contents
. Returns the new Comment
.
17 18 19 |
# File 'lib/dropio/asset.rb', line 17 def create_comment(contents) Dropio::Client.instance.create_comment(self, contents) end |
#destroy! ⇒ Object
Destroys the asset on drop.io. Don’t try to use an Asset after destroying it.
27 28 29 30 |
# File 'lib/dropio/asset.rb', line 27 def destroy! Dropio::Client.instance.destroy_asset(self) nil end |
#faxable? ⇒ Boolean
Returns true if the Asset can be faxed.
33 34 35 |
# File 'lib/dropio/asset.rb', line 33 def faxable? return type.downcase == "document" end |
#generate_url ⇒ Object
Generates an authenticated URL that will bypass any login action.
56 57 58 |
# File 'lib/dropio/asset.rb', line 56 def generate_url Dropio::Client.instance.generate_asset_url(self) end |
#save ⇒ Object
Saves the asset back to drop.io.
22 23 24 |
# File 'lib/dropio/asset.rb', line 22 def save Dropio::Client.instance.save_asset(self) end |
#send_to_drop(drop_name) ⇒ Object
Sends the asset to a Drop by drop_name
51 52 53 |
# File 'lib/dropio/asset.rb', line 51 def send_to_drop(drop_name) Dropio::Client.instance.send_to_drop(self, drop_name) end |
#send_to_emails(emails = [], message = nil) ⇒ Object
Sends the asset to the given emails
with an optional message
.
46 47 48 |
# File 'lib/dropio/asset.rb', line 46 def send_to_emails(emails = [], = nil) Dropio::Client.instance.send_to_emails(self, emails, ) end |
#send_to_fax(fax_number) ⇒ Object
Fax the asset to the given fax_number
. Make sure the Asset is faxable?
first, or send_to_fax
will raise an error.
39 40 41 42 43 |
# File 'lib/dropio/asset.rb', line 39 def send_to_fax(fax_number) raise "Can't fax Asset: #{self.inspect} is not faxable" unless faxable? Dropio::Client.instance.send_to_fax(self, fax_number) nil end |