Class: Bond::Account
- Inherits:
-
Object
- Object
- Bond::Account
- Defined in:
- lib/bond/account.rb
Instance Attribute Summary collapse
-
#credits ⇒ Object
Returns the value of attribute credits.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#links ⇒ Object
Returns the value of attribute links.
Instance Method Summary collapse
-
#initialize ⇒ Account
constructor
A new instance of Account.
Constructor Details
#initialize ⇒ Account
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
#credits ⇒ Object
Returns the value of attribute credits.
6 7 8 |
# File 'lib/bond/account.rb', line 6 def credits @credits end |
#email ⇒ Object
Returns the value of attribute email.
6 7 8 |
# File 'lib/bond/account.rb', line 6 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
6 7 8 |
# File 'lib/bond/account.rb', line 6 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
6 7 8 |
# File 'lib/bond/account.rb', line 6 def last_name @last_name end |
#links ⇒ Object
Returns the value of attribute links.
6 7 8 |
# File 'lib/bond/account.rb', line 6 def links @links end |