lib/billogram/client.rb in billogram-0.0.1 vs lib/billogram/client.rb in billogram-0.2.0
- old
+ new
@@ -1,22 +1,14 @@
module Billogram
- # https://github.com/lendai/billogram-api-clients/tree/master/ruby
class Client
include HTTParty
- extend Forwardable
-
- HEADERS = {
- "Accept" => "application/json",
- "Content-Type" => "application/json"
- }
-
- headers HEADERS
format :json
- delegate [:get, :post, :put, :delete] => self
+ def initialize(username, password, base_uri)
+ self.class.default_options.merge!(base_uri: base_uri, basic_auth: {username: username, password: password})
+ end
- def initialize(username, password, base_uri = Billogram.base_url)
- self.class.base_uri base_uri
- self.class.basic_auth username, password
+ def get(*args)
+ self.class.get(*args)
end
end
end