Class: CF::Account

Inherits:
Object
  • Object
show all
Includes:
Client
Defined in:
lib/cf/account.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.errorsObject

Contains Error message if any



8
9
10
# File 'lib/cf/account.rb', line 8

def errors
  @errors
end

Class Method Details

.infoObject

Returns Account Info

Usage Example:

CF::Account.info


13
14
15
16
17
18
19
20
# File 'lib/cf/account.rb', line 13

def info
  resp = get('/account.json')

  if resp.code != 200
    self.errors = resp.error.message
  end
  return resp
end

.login(email, passwd) ⇒ Object

Login to CloudFactory app through cloudfactory GEM

Usage Example:

CF::Account.("[email protected]", "password")


33
34
35
36
# File 'lib/cf/account.rb', line 33

def (email, passwd)
  resp = post('/account_login.json', :user => {:email => email, :password => passwd})
  resp
end

.valid?Boolean

Validation of account

Usage Example:

CF::Account.valid?

Returns:

  • (Boolean)


25
26
27
28
# File 'lib/cf/account.rb', line 25

def valid?
  info
  errors.nil?
end