Class: Freshmaker::Client
- Inherits:
-
Object
- Object
- Freshmaker::Client
- Includes:
- HTTParty
- Defined in:
- lib/freshmaker/client.rb
Instance Method Summary collapse
- #get(path, options = {}) ⇒ Object
-
#initialize(email, password) ⇒ Client
constructor
A new instance of Client.
- #tickets ⇒ Object
- #users ⇒ Object
Constructor Details
#initialize(email, password) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/freshmaker/client.rb', line 9 def initialize(email, password) @auth = { username: email, password: password } end |
Instance Method Details
#get(path, options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/freshmaker/client.rb', line 13 def get(path, ={}) .merge!({ basic_auth: @auth }) self.class.get("#{path}.xml?", ) end |
#tickets ⇒ Object
22 23 24 |
# File 'lib/freshmaker/client.rb', line 22 def tickets Freshmaker::TicketProxy.new(self) end |
#users ⇒ Object
18 19 20 |
# File 'lib/freshmaker/client.rb', line 18 def users Freshmaker::UserProxy.new(self) end |