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 Attribute Summary collapse
-
#api_url ⇒ Object
readonly
Returns the value of attribute api_url.
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.
7 8 9 |
# File 'lib/wo/client.rb', line 7 def initialize( = {}) @api_url = [:url] ? [:url] : API_URL end |
Instance Attribute Details
#api_url ⇒ Object (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( = {}) request(:post, "#{@api_url}/doings", Configure.new().to_h) end |
#create_organization ⇒ Object
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( = {}) request(:get, "#{@api_url}/users", Configure.new().to_h) end |