Class: WIS::Client::Accounts
- Inherits:
-
Object
- Object
- WIS::Client::Accounts
- Defined in:
- lib/client/accounts.rb
Class Method Summary collapse
- .find_by_id(id) ⇒ Object
- .find_by_id_array(ids) ⇒ Object
- .find_by_name(name) ⇒ Object
- .find_by_name_array(names) ⇒ Object
- .search(string) ⇒ Object
Class Method Details
.find_by_id(id) ⇒ Object
9 10 11 |
# File 'lib/client/accounts.rb', line 9 def self.find_by_id(id) WIS::DOM::Account.adapt_json(WIS::Client::Tools.get_json("http://api.whereistand.com/accounts/" + id.to_s)) end |
.find_by_id_array(ids) ⇒ Object
13 14 15 16 |
# File 'lib/client/accounts.rb', line 13 def self.find_by_id_array(ids) result = WIS::Client::Tools.get_json("http://api.whereistand.com/accounts?ids=" + ids.join(",")) WIS::DOM::Account.adapt_json(result) end |
.find_by_name(name) ⇒ Object
18 19 20 |
# File 'lib/client/accounts.rb', line 18 def self.find_by_name(name) WIS::DOM::Account.adapt_json(WIS::Client::Tools.get_json("http://api.whereistand.com/accounts/" + name)) end |
.find_by_name_array(names) ⇒ Object
22 23 24 25 |
# File 'lib/client/accounts.rb', line 22 def self.find_by_name_array(names) result = WIS::Client::Tools.get_json("http://api.whereistand.com/accounts?names=" + names.join(",")) WIS::DOM::Account.adapt_json(result) end |
.search(string) ⇒ Object
3 4 5 6 7 |
# File 'lib/client/accounts.rb', line 3 def self.search(string) string = WIS::Client::Tools.uri_escape(string) results = WIS::Client::Tools.get_json("http://api.whereistand.com/accounts?search=" + string) WIS::DOM::AccountResults.adapt_json(results) end |