Class: CloudApp::Account
Overview
An ActiveResource-like interface through which to interract with CloudApp accounts.
Instance Attribute Summary (collapse)
-
- (Object) activated_at
readonly
Returns the value of attribute activated_at.
-
- (Object) alpha
readonly
Returns the value of attribute alpha.
-
- (Object) created_at
readonly
Returns the value of attribute created_at.
-
- (Object) domain
readonly
Returns the value of attribute domain.
-
- (Object) domain_home_page
readonly
Returns the value of attribute domain_home_page.
-
- (Object) email
readonly
Returns the value of attribute email.
-
- (Object) id
readonly
Returns the value of attribute id.
-
- (Object) private_items
readonly
Returns the value of attribute private_items.
-
- (Object) subscribed
readonly
Returns the value of attribute subscribed.
-
- (Object) updated_at
readonly
Returns the value of attribute updated_at.
Class Method Summary (collapse)
-
+ (CloudApp::Account) create(opts = {})
Create a CloudApp account.
-
+ (CloudApp::Account) find
Get the basic details of the authenticated account.
-
+ (Boolean) reset(opts = {})
Dispatch an email containing a link to reset the account's password.
-
+ (Hash) stats
Get the total number of drops created and total views for all drops.
-
+ (CloudApp::Account) update(opts = {})
Modify the authenticated accounts details.
Instance Method Summary (collapse)
-
- (Account) initialize(attributes = {})
constructor
Create a new CloudApp::Account object.
-
- (Boolean) reset
Dispatch an email containing a link to reset the account's password.
-
- (Hash) stats
Get the total number of drops created and total views for all drops.
-
- (CloudApp::Account) update(opts = {})
Modify the authenticated accounts details.
Methods inherited from Base
Constructor Details
- (Account) initialize(attributes = {})
Create a new CloudApp::Account object.
Only used internally
126 127 128 |
# File 'lib/cloudapp/account.rb', line 126 def initialize(attributes = {}) load(attributes) end |
Instance Attribute Details
- (Object) activated_at (readonly)
Returns the value of attribute activated_at
117 118 119 |
# File 'lib/cloudapp/account.rb', line 117 def activated_at @activated_at end |
- (Object) alpha (readonly)
Returns the value of attribute alpha
117 118 119 |
# File 'lib/cloudapp/account.rb', line 117 def alpha @alpha end |
- (Object) created_at (readonly)
Returns the value of attribute created_at
117 118 119 |
# File 'lib/cloudapp/account.rb', line 117 def created_at @created_at end |
- (Object) domain (readonly)
Returns the value of attribute domain
117 118 119 |
# File 'lib/cloudapp/account.rb', line 117 def domain @domain end |
- (Object) domain_home_page (readonly)
Returns the value of attribute domain_home_page
117 118 119 |
# File 'lib/cloudapp/account.rb', line 117 def domain_home_page @domain_home_page end |
- (Object) email (readonly)
Returns the value of attribute email
117 118 119 |
# File 'lib/cloudapp/account.rb', line 117 def email @email end |
- (Object) id (readonly)
Returns the value of attribute id
117 118 119 |
# File 'lib/cloudapp/account.rb', line 117 def id @id end |
- (Object) private_items (readonly)
Returns the value of attribute private_items
117 118 119 |
# File 'lib/cloudapp/account.rb', line 117 def private_items @private_items end |
- (Object) subscribed (readonly)
Returns the value of attribute subscribed
117 118 119 |
# File 'lib/cloudapp/account.rb', line 117 def subscribed @subscribed end |
- (Object) updated_at (readonly)
Returns the value of attribute updated_at
117 118 119 |
# File 'lib/cloudapp/account.rb', line 117 def updated_at @updated_at end |
Class Method Details
+ (CloudApp::Account) create(opts = {})
Create a CloudApp account.
71 72 73 74 |
# File 'lib/cloudapp/account.rb', line 71 def self.create(opts = {}) res = post "/register", :body => {:user => opts} res.ok? ? Account.new(res) : res end |
+ (CloudApp::Account) find
Get the basic details of the authenticated account.
Requires authentication.
59 60 61 62 |
# File 'lib/cloudapp/account.rb', line 59 def self.find res = get "/account", :digest_auth => @@auth res.ok? ? Account.new(res) : res end |
+ (Boolean) reset(opts = {})
Dispatch an email containing a link to reset the account's password.
102 103 104 105 |
# File 'lib/cloudapp/account.rb', line 102 def self.reset(opts = {}) res = post "/reset", :body => {:user => opts} res.ok? ? true : res end |
+ (Hash) stats
Get the total number of drops created and total views for all drops.
Requires authentication.
112 113 114 115 |
# File 'lib/cloudapp/account.rb', line 112 def self.stats res = get "/account/stats", :digest_auth => @@auth res.ok? ? res.symbolize_keys! : res end |
+ (CloudApp::Account) update(opts = {})
Modify the authenticated accounts details. Can change the default security of newly created drops, the accounts email address, password, and custom domain details.
Note that when changing email address or password, the current password is required. Also note that to change custom domains requires an account with a Pro subscription.
Requires authentication
92 93 94 95 |
# File 'lib/cloudapp/account.rb', line 92 def self.update(opts = {}) res = put "/account", {:body => {:user => opts}, :digest_auth => @@auth} res.ok? ? Account.new(res) : res end |
Instance Method Details
- (Boolean) reset
Dispatch an email containing a link to reset the account's password.
153 154 155 |
# File 'lib/cloudapp/account.rb', line 153 def reset self.class.reset :email => self.email end |
- (Hash) stats
Get the total number of drops created and total views for all drops.
160 161 162 |
# File 'lib/cloudapp/account.rb', line 160 def stats self.class.stats end |
- (CloudApp::Account) update(opts = {})
Modify the authenticated accounts details. Can change the default security of newly created drops, the accounts email address, password, and custom domain details.
Note that when changing email address or password, the current password is required. Also note that to change custom domains requires an account with a Pro subscription.
144 145 146 |
# File 'lib/cloudapp/account.rb', line 144 def update(opts = {}) self.class.update opts end |