Class: Bond::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/bond/account.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAccount

Returns a new instance of Account.



8
9
10
11
12
13
14
15
16
# File 'lib/bond/account.rb', line 8

def initialize
  response = Bond::Connection.connection.get('/account')
  json = JSON.parse(response.body)

  Bond::BondError.handle_errors(json)

  json['data'].each { |name, value| instance_variable_set("@#{name}", value) }
  @links = json['links']
end

Instance Attribute Details

#creditsObject

Returns the value of attribute credits.



6
7
8
# File 'lib/bond/account.rb', line 6

def credits
  @credits
end

#emailObject

Returns the value of attribute email.



6
7
8
# File 'lib/bond/account.rb', line 6

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name.



6
7
8
# File 'lib/bond/account.rb', line 6

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name.



6
7
8
# File 'lib/bond/account.rb', line 6

def last_name
  @last_name
end

Returns the value of attribute links.



6
7
8
# File 'lib/bond/account.rb', line 6

def links
  @links
end