Class: CF::Account
Class Attribute Summary collapse
-
.errors ⇒ Object
Contains Error message if any.
Class Method Summary collapse
-
.info ⇒ Object
Returns Account Info ===Usage Example: CF::Account.info.
-
.login(email, passwd) ⇒ Object
Login to CloudFactory app through cloudfactory GEM ===Usage Example: CF::Account.login(“[email protected]”, “password”).
-
.valid? ⇒ Boolean
Validation of account ===Usage Example: CF::Account.valid?.
Class Attribute Details
.errors ⇒ Object
Contains Error message if any
8 9 10 |
# File 'lib/cf/account.rb', line 8 def errors @errors end |
Class Method Details
.info ⇒ Object
13 14 15 16 17 |
# File 'lib/cf/account.rb', line 13 def info resp = get('/account.json') self.errors = resp['error']['message'] if resp['code'] != 200 return resp end |
.login(email, passwd) ⇒ Object
Login to CloudFactory app through cloudfactory GEM
Usage Example:
CF::Account.login("[email protected]", "password")
30 31 32 33 34 |
# File 'lib/cf/account.rb', line 30 def login(email, passwd) resp = post('/account_login.json', :user => {:email => email, :password => passwd}) self.errors = resp['error']['message'] if resp['code'] != 200 return resp end |