Class: WO::Client
- Inherits:
-
Object
- Object
- WO::Client
- Defined in:
- lib/wo/client.rb
Constant Summary collapse
- API_URL =
"https://wo-app.herokuapp.com"
Instance Method Summary collapse
- #create_doing(options = {}) ⇒ Object
- #create_organization ⇒ Object
- #doings(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
5 6 7 |
# File 'lib/wo/client.rb', line 5 def initialize( = {}) @api_url = [:url] ? [:url] : API_URL end |
Instance Method Details
#create_doing(options = {}) ⇒ Object
13 14 15 |
# File 'lib/wo/client.rb', line 13 def create_doing( = {}) request(:post, "#{@api_url}/doings", Configure.new().to_h) end |
#create_organization ⇒ Object
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( = {}) request(:get, "#{@api_url}/users", Configure.new().to_h) end |