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 Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/wo/client.rb', line 7

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

Instance Attribute Details

#api_urlObject (readonly)

Returns the value of attribute api_url.



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

def api_url
  @api_url
end

Instance Method Details

#create_doing(options = {}) ⇒ Object



15
16
17
# File 'lib/wo/client.rb', line 15

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

#create_organizationObject



19
20
21
# File 'lib/wo/client.rb', line 19

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

#doings(options = {}) ⇒ Object



11
12
13
# File 'lib/wo/client.rb', line 11

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