Class: WO::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/wo/client.rb

Constant Summary collapse

API_URL =
"https://wo-app.herokuapp.com"

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



5
6
7
# File 'lib/wo/client.rb', line 5

def initialize(options = {})
  @api_url = options[:url] ? options[:url] : API_URL
end

Instance Method Details

#create_doing(options = {}) ⇒ Object



13
14
15
# File 'lib/wo/client.rb', line 13

def create_doing(options = {})
  request(:post, "#{@api_url}/doings", Configure.new(options).to_h)
end

#create_organizationObject



17
18
19
# File 'lib/wo/client.rb', line 17

def create_organization
  request(:post, "#{@api_url}/organizations")
end

#doings(options = {}) ⇒ Object



9
10
11
# File 'lib/wo/client.rb', line 9

def doings(options = {})
  request(:get, "#{@api_url}/users", Configure.new(options).to_h)
end