Class: Dropio::Drop

Inherits:
Resource show all
Defined in:
lib/dropio/drop.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

client, #initialize

Constructor Details

This class inherits a constructor from Dropio::Resource

Instance Attribute Details

#admin_emailObject

Returns the value of attribute admin_email.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def admin_email
  @admin_email
end

#admin_passwordObject

Returns the value of attribute admin_password.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def admin_password
  @admin_password
end

#admin_tokenObject

Returns the value of attribute admin_token.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def admin_token
  @admin_token
end

#asset_countObject

Returns the value of attribute asset_count.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def asset_count
  @asset_count
end

#chat_passwordObject

Returns the value of attribute chat_password.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def chat_password
  @chat_password
end

#conferenceObject

Returns the value of attribute conference.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def conference
  @conference
end

#current_bytesObject

Returns the value of attribute current_bytes.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def current_bytes
  @current_bytes
end

#default_viewObject

Returns the value of attribute default_view.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def default_view
  @default_view
end

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def description
  @description
end

#emailObject

Returns the value of attribute email.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def email
  @email
end

#email_keyObject

Returns the value of attribute email_key.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def email_key
  @email_key
end

#expiration_lengthObject

Returns the value of attribute expiration_length.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def expiration_length
  @expiration_length
end

#expires_atObject

Returns the value of attribute expires_at.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def expires_at
  @expires_at
end

#faxObject

Returns the value of attribute fax.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def fax
  @fax
end

#guest_tokenObject

Returns the value of attribute guest_token.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def guest_token
  @guest_token
end

#guests_can_addObject

Returns the value of attribute guests_can_add.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def guests_can_add
  @guests_can_add
end

#guests_can_commentObject

Returns the value of attribute guests_can_comment.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def guests_can_comment
  @guests_can_comment
end

#guests_can_deleteObject

Returns the value of attribute guests_can_delete.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def guests_can_delete
  @guests_can_delete
end

#hidden_upload_urlObject

Returns the value of attribute hidden_upload_url.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def hidden_upload_url
  @hidden_upload_url
end

#max_bytesObject

Returns the value of attribute max_bytes.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def max_bytes
  @max_bytes
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def name
  @name
end

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def password
  @password
end

#premium_codeObject

Returns the value of attribute premium_code.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def premium_code
  @premium_code
end

#rssObject

Returns the value of attribute rss.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def rss
  @rss
end

#voicemailObject

Returns the value of attribute voicemail.



3
4
5
# File 'lib/dropio/drop.rb', line 3

def voicemail
  @voicemail
end

Class Method Details

.create(attributes = {}) ⇒ Object

Creates a drop with an attributes hash. Valid attributes: name (string), default_view (string), guests_can_comment (boolean), guests_can_add (boolean), guests_can_delete (boolean), expiration_length (string), password (string), admin_password (string), and premium_code (string) Descriptions can be found here: groups.google.com/group/dropio-api/web/full-api-documentation



31
32
33
# File 'lib/dropio/drop.rb', line 31

def self.create(attributes = {})
  Dropio::Resource.client.create_drop(attributes)
end

.find(name, token = nil) ⇒ Object

Finds a drop with name and optional authorization token



19
20
21
# File 'lib/dropio/drop.rb', line 19

def self.find(name, token = nil)
  Dropio::Resource.client.drop(name, token)
end

.find_manager_drops(manager_api_token, page = 1) ⇒ Object

Finds all the drops associated with a manager account.



24
25
26
# File 'lib/dropio/drop.rb', line 24

def self.find_manager_drops(manager_api_token, page = 1)
  Dropio::Resource.client.manager_drops(manager_api_token, page)
end

Instance Method Details

#add_file(file_path, description = nil, convert_to = nil, pingback_url = nil, comment = nil) ⇒ Object

Adds a file to the Drop given the file_path.



71
72
73
# File 'lib/dropio/drop.rb', line 71

def add_file(file_path, description = nil, convert_to = nil, pingback_url = nil, comment = nil)
  Dropio::Resource.client.add_file(self, file_path, description, convert_to, pingback_url, comment)
end

#add_file_from_url(url, description = nil, convert_to = nil, pingback_url = nil) ⇒ Object

Adds a file to the Drop from a given url



66
67
68
# File 'lib/dropio/drop.rb', line 66

def add_file_from_url(url, description = nil, convert_to = nil, pingback_url = nil)
  Dropio::Resource.client.add_file_from_url(self,url,description, convert_to, pingback_url)
end

#assets(page = 1, order = :oldest) ⇒ Object

Gets a list of assets associated with the Drop. Paginated at



14
15
16
# File 'lib/dropio/drop.rb', line 14

def assets(page = 1, order = :oldest)
  Dropio::Resource.client.assets(self, page, order)
end

#change_name(new_name) ⇒ Object

Changes the name of a drop. Admin token required. Has to be 7 characters or more unless premium.



36
37
38
# File 'lib/dropio/drop.rb', line 36

def change_name(new_name)
  Dropio::Resource.client.change_drop_name(self,new_name)
end

#create_email_subscription(email, message = nil, welcome_message = nil, welcome_subject = nil, welcome_from = nil, events = {}) ⇒ Object

Creates an email Subscription



96
97
98
# File 'lib/dropio/drop.rb', line 96

def create_email_subscription(email, message = nil, welcome_message = nil, welcome_subject = nil, welcome_from = nil, events = {})
  Dropio::Resource.client.create_email_subscription(self,email,message,welcome_message,welcome_subject,welcome_from, events)
end

Creates a link with a url, title, and description.



81
82
83
# File 'lib/dropio/drop.rb', line 81

def create_link(url, title = nil, description = nil)
  Dropio::Resource.client.create_link(self, url, title, description)
end

#create_note(contents, title = nil, description = nil) ⇒ Object

Creates a note with a title and contents



76
77
78
# File 'lib/dropio/drop.rb', line 76

def create_note(contents, title = nil, description = nil)
  Dropio::Resource.client.create_note(self, contents, title, description)
end

#create_pingback_subscription(url, events = {}) ⇒ Object

Creates a subscription to receive POSTs from drop.io.



86
87
88
# File 'lib/dropio/drop.rb', line 86

def create_pingback_subscription(url, events = {})
  Dropio::Resource.client.create_pingback_subscription(self,url,events)
end

#create_twitter_subscription(username, password, message = nil, events = {}) ⇒ Object

Creates a Twitter Subscription



91
92
93
# File 'lib/dropio/drop.rb', line 91

def create_twitter_subscription(username,password,message = nil, events = {})
 Dropio::Resource.client.create_twitter_subscription(self,username,password,message,events)
end

#default_tokenObject

Gets the default token to be used, prefers the admin token.



9
10
11
# File 'lib/dropio/drop.rb', line 9

def default_token
  self.admin_token || self.guest_token
end

#destroy!Object

Deletes the Drop from the system including all associated assets.



61
62
63
# File 'lib/dropio/drop.rb', line 61

def destroy!
  Dropio::Resource.client.delete_drop(self)
end

#emptyObject

Empties the drop, including it’s assets.



46
47
48
# File 'lib/dropio/drop.rb', line 46

def empty
  Dropio::Resource.client.empty_drop(self)
end

#generate_urlObject

Generates an authenticated URL that will bypass any login action.



106
107
108
# File 'lib/dropio/drop.rb', line 106

def generate_url
  Dropio::Resource.client.generate_drop_url(self)
end

#promote(nick) ⇒ Object

Promotes a nickname in the drop chat to admin.



51
52
53
# File 'lib/dropio/drop.rb', line 51

def promote(nick)
  Dropio::Resource.client.promote_nick(self,nick)
end

#saveObject

Saves the Drop.



56
57
58
# File 'lib/dropio/drop.rb', line 56

def save
  Dropio::Resource.client.update_drop(self)
end

#subscriptions(page = 1) ⇒ Object

Gets a list of Subscription objects.



101
102
103
# File 'lib/dropio/drop.rb', line 101

def subscriptions(page = 1)
  Dropio::Resource.client.subscriptions(self, page)
end

#upload_codeObject

Gets the drop’s embeddable uploader code



41
42
43
# File 'lib/dropio/drop.rb', line 41

def upload_code
  Dropio::Resource.client.drop_upload_code(self)
end