Class: Whuffiebank::Client
- Inherits:
-
Object
- Object
- Whuffiebank::Client
- Includes:
- HTTParty
- Defined in:
- lib/whuffiebank/client.rb
Instance Method Summary collapse
- #balance(username, password) ⇒ Object
- #give_whuffie(username, password, to_username, amount, options = {}) ⇒ Object
- #whuffie(username) ⇒ Object
Instance Method Details
#balance(username, password) ⇒ Object
8 9 10 11 |
# File 'lib/whuffiebank/client.rb', line 8 def balance(username,password) response = handle_response(self.class.get("/balance/", :query => {:username => username, :password => password})) Whuffiebank::Balance.new(response) end |
#give_whuffie(username, password, to_username, amount, options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/whuffiebank/client.rb', line 13 def give_whuffie(username,password,to_username,amount,={}) response = handle_response(self.class.post("/give/", :body => {:username => username, :password => password, :to => to_username, :amount => amount})) Whuffiebank::GiveResponse.new(response) end |
#whuffie(username) ⇒ Object
18 19 20 21 |
# File 'lib/whuffiebank/client.rb', line 18 def whuffie(username) response = handle_response(self.class.get("/whuffie/", :query => {:username => username} )) Whuffiebank::Whuffie.new(response) end |