Class: BadBill::Client
- Inherits:
-
BaseResource
- Object
- BaseResource
- BadBill::Client
- Defined in:
- lib/badbill/client.rb
Overview
The clients resource handles all clients.
Instance Attribute Summary collapse
-
#myself ⇒ Object
writeonly
Sets the attribute myself.
Attributes inherited from BaseResource
Class Method Summary collapse
-
.myself ⇒ Client
Fetch information about yourself.
Instance Method Summary collapse
-
#initialize(id, data) ⇒ Client
constructor
A new instance of Client.
-
#myself? ⇒ Boolean
Indicates wether this resource is yourself or not.
Methods inherited from BaseResource
all, create, #delete, #error, find, #save
Methods included from Resource
#call, #delete, #get, #post, #put
Methods included from ForwardMethods
Constructor Details
#initialize(id, data) ⇒ Client
Returns a new instance of Client.
10 11 12 13 |
# File 'lib/badbill/client.rb', line 10 def initialize id, data super @myself = false end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BadBill::ForwardMethods
Instance Attribute Details
#myself=(value) ⇒ Object (writeonly)
Sets the attribute myself
8 9 10 |
# File 'lib/badbill/client.rb', line 8 def myself=(value) @myself = value end |
Class Method Details
.myself ⇒ Client
Fetch information about yourself.
18 19 20 21 22 23 |
# File 'lib/badbill/client.rb', line 18 def self.myself c = get 'clients', 'myself' client = new c.client.id.to_i, c.client client.myself = true client end |
Instance Method Details
#myself? ⇒ Boolean
Indicates wether this resource is yourself or not.
28 29 30 |
# File 'lib/badbill/client.rb', line 28 def myself? @myself end |