Class: Alegra::Client
- Inherits:
-
Object
- Object
- Alegra::Client
- Defined in:
- lib/alegra/client.rb
Instance Method Summary collapse
- #contacts ⇒ Object
- #get(url, params = {}) ⇒ Object
-
#initialize(username = nil, apikey = nil, debug = false) ⇒ Client
constructor
A new instance of Client.
- #invoices ⇒ Object
- #post(url, params = {}) ⇒ Object
Constructor Details
#initialize(username = nil, apikey = nil, debug = false) ⇒ Client
Returns a new instance of Client.
8 9 10 |
# File 'lib/alegra/client.rb', line 8 def initialize(username=nil, apikey=nil, debug=false) @setup = Alegra::Setup.new(username, apikey, debug) end |
Instance Method Details
#contacts ⇒ Object
26 27 28 |
# File 'lib/alegra/client.rb', line 26 def contacts Alegra::Contacts.new(self) end |
#get(url, params = {}) ⇒ Object
12 13 14 15 |
# File 'lib/alegra/client.rb', line 12 def get(url, params={}) request = Alegra::Request.new(@setup.host, @setup.path, @setup.token) request.get(url, params) end |
#invoices ⇒ Object
22 23 24 |
# File 'lib/alegra/client.rb', line 22 def invoices Alegra::Invoices.new(self) end |
#post(url, params = {}) ⇒ Object
17 18 19 20 |
# File 'lib/alegra/client.rb', line 17 def post(url, params={}) request = Alegra::Request.new(@setup.host, @setup.path, @setup.token) request.post(url, params) end |