Class: Freshmaker::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/freshmaker/client.rb

Instance Method Summary collapse

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, options={})
  options.merge!({ basic_auth: @auth })
  self.class.get("#{path}.xml?", options)
end

#ticketsObject



22
23
24
# File 'lib/freshmaker/client.rb', line 22

def tickets
  Freshmaker::TicketProxy.new(self)
end

#usersObject



18
19
20
# File 'lib/freshmaker/client.rb', line 18

def users
  Freshmaker::UserProxy.new(self)
end