Class: Cashboard::Account
- Inherits:
-
Base
- Object
- OpenStruct
- TypecastedOpenStruct
- Struct
- Base
- Cashboard::Account
- Defined in:
- lib/cashboard/account.rb
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.resource_name ⇒ Object
Account is the only singular resource for the Cashboard API.
Instance Method Summary collapse
- #href ⇒ Object
-
#initialize(hash = {}) ⇒ Account
constructor
We get some sub-resources that we need to turn into Cashboard::Structs so we can access their information in a friendly way.
Methods inherited from Base
authenticate, clear_authentication, create, #delete, #links, list, new_from_url, #to_xml, #update
Methods inherited from TypecastedOpenStruct
Constructor Details
#initialize(hash = {}) ⇒ Account
We get some sub-resources that we need to turn into Cashboard::Structs so we can access their information in a friendly way.
9 10 11 12 13 14 |
# File 'lib/cashboard/account.rb', line 9 def initialize(hash={}) super hash self.owner = Cashboard::Struct.new(self.owner) self.company = Cashboard::Struct.new(self.company) self end |
Class Method Details
.resource_name ⇒ Object
Account is the only singular resource for the Cashboard API.
4 |
# File 'lib/cashboard/account.rb', line 4 def self.resource_name; 'account'; end |
Instance Method Details
#href ⇒ Object
16 17 18 |
# File 'lib/cashboard/account.rb', line 16 def href "/#{self.class.resource_name}" end |