Created
November 14, 2012 00:56
-
-
Save smarden1/4069497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[92] pry(main)> Taskrabbit.configure do |config| | |
[92] pry(main)* config.api_secret = 'SECRET_KEY' | |
[92] pry(main)* config.api_key = 'CovsfUly0Atqk2bnxfvSVNE0FH1c2YqsQjXKvWRN' | |
[92] pry(main)* config.base_uri = 'https://taskrabbitdev.com' | |
[92] pry(main)* config.endpoint = 'api/v1' | |
[92] pry(main)* end | |
=> Taskrabbit | |
[93] pry(main)> tr = Taskrabbit::Api.new("my oauth token") | |
=> #<Taskrabbit::Api:0x00000100b062c8 | |
@api_key="SECRET_KEY", | |
@api_secret="CagSSJtgjjpySZDAm9goNidj5bY2SlaUW7uTLSTx", | |
@base_uri="https://taskrabbitdev.com", | |
@endpoint="api/v1", | |
@user_token="my oauth token"> | |
[94] pry(main)> | |
[95] pry(main)> task = tr.tasks.new({:named_price => 32, :name => 'Ikea'}) | |
=> {"description"=>"", | |
"private_description"=>"", | |
"private_runner"=>false, | |
"virtual"=>false, | |
"named_price"=>32, | |
"name"=>"Ikea"} | |
[96] pry(main)> task.save | |
Taskrabbit::Error: There must be an authenticated user for this action | |
from /Users/stevemardenfeld/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/taskrabbit-0.1.0/lib/taskrabbit/client.rb:42:in `check_response_errors' | |
[97] pry(main)> | |
[98] pry(main)> | |
[99] pry(main)> tr.account | |
=> {"runner"=>false} | |
[100] pry(main)> tr.account.tasks | |
=> Taskrabbit::Task | |
[101] pry(main)> tr.account.tasks.all | |
Taskrabbit::Error: There must be an authenticated user for this action | |
from /Users/stevemardenfeld/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/taskrabbit-0.1.0/lib/taskrabbit/client.rb:42:in `check_response_errors' | |
[102] pry(main)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment