Class: CloudApp::Account
Overview
An ActiveResource-like interface through which to interract with the CloudApp API.
Instance Attribute Summary collapse
-
#activated_at ⇒ Object
readonly
Returns the value of attribute activated_at.
-
#alpha ⇒ Object
readonly
Returns the value of attribute alpha.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#domain_home_page ⇒ Object
readonly
Returns the value of attribute domain_home_page.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#private_items ⇒ Object
readonly
Returns the value of attribute private_items.
-
#subscribed ⇒ Object
readonly
Returns the value of attribute subscribed.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
-
.create(opts = {}) ⇒ CloudApp::Account
Create a CloudApp account.
-
.find ⇒ CloudApp::Account
Get the basic details of the authenticated account.
-
.reset(opts = {}) ⇒ Boolean
Dispatch an email containing a link to reset the account’s password.
-
.update(opts = {}) ⇒ CloudApp::Account
Modify the authenticated accounts details.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Account
constructor
Create a new CloudApp::Account object.
-
#reset ⇒ Boolean
Dispatch an email containing a link to reset the account’s password.
-
#update(opts = {}) ⇒ CloudApp::Account
Modify the authenticated accounts details.
Methods inherited from Base
Constructor Details
#initialize(attributes = {}) ⇒ Account
Create a new CloudApp::Account object. Only used internally
102 103 104 |
# File 'lib/cloudapp/account.rb', line 102 def initialize(attributes = {}) load(attributes) end |
Instance Attribute Details
#activated_at ⇒ Object (readonly)
Returns the value of attribute activated_at.
95 96 97 |
# File 'lib/cloudapp/account.rb', line 95 def activated_at @activated_at end |
#alpha ⇒ Object (readonly)
Returns the value of attribute alpha.
95 96 97 |
# File 'lib/cloudapp/account.rb', line 95 def alpha @alpha end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
95 96 97 |
# File 'lib/cloudapp/account.rb', line 95 def created_at @created_at end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
95 96 97 |
# File 'lib/cloudapp/account.rb', line 95 def domain @domain end |
#domain_home_page ⇒ Object (readonly)
Returns the value of attribute domain_home_page.
95 96 97 |
# File 'lib/cloudapp/account.rb', line 95 def domain_home_page @domain_home_page end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
95 96 97 |
# File 'lib/cloudapp/account.rb', line 95 def email @email end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
95 96 97 |
# File 'lib/cloudapp/account.rb', line 95 def id @id end |
#private_items ⇒ Object (readonly)
Returns the value of attribute private_items.
95 96 97 |
# File 'lib/cloudapp/account.rb', line 95 def private_items @private_items end |
#subscribed ⇒ Object (readonly)
Returns the value of attribute subscribed.
95 96 97 |
# File 'lib/cloudapp/account.rb', line 95 def subscribed @subscribed end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
95 96 97 |
# File 'lib/cloudapp/account.rb', line 95 def updated_at @updated_at end |
Class Method Details
.create(opts = {}) ⇒ CloudApp::Account
Create a CloudApp account.
61 62 63 64 |
# File 'lib/cloudapp/account.rb', line 61 def self.create(opts = {}) res = post "/register", :body => {:user => opts} res.ok? ? Account.new(res) : res end |
.find ⇒ CloudApp::Account
Get the basic details of the authenticated account. Requires authentication.
51 52 53 54 |
# File 'lib/cloudapp/account.rb', line 51 def self.find res = get "/account", :digest_auth => @@auth res.ok? ? Account.new(res) : res end |
.reset(opts = {}) ⇒ Boolean
Dispatch an email containing a link to reset the account’s password.
90 91 92 93 |
# File 'lib/cloudapp/account.rb', line 90 def self.reset(opts = {}) res = post "/reset", :body => {:user => opts} res.ok? ? true : res end |
.update(opts = {}) ⇒ CloudApp::Account
Modify the authenticated accounts details. Can change the default security of newly created items, the accounts email address, password, and custom domain details. Note that to custom domains requires and account with a Pro subscription. Requires authentication.
80 81 82 83 |
# File 'lib/cloudapp/account.rb', line 80 def self.update(opts = {}) res = put "/account", {:body => {:user => opts}, :digest_auth => @@auth} res.ok? ? Account.new(res) : res end |
Instance Method Details
#reset ⇒ Boolean
Dispatch an email containing a link to reset the account’s password.
126 127 128 |
# File 'lib/cloudapp/account.rb', line 126 def reset self.class.reset :email => self.email end |
#update(opts = {}) ⇒ CloudApp::Account
Modify the authenticated accounts details. Can change the default security of newly created items, the accounts email address, password, and custom domain details. Note that to custom domains requires and account with a Pro subscription. Requires authentication.
120 121 122 |
# File 'lib/cloudapp/account.rb', line 120 def update(opts = {}) self.class.update opts end |