Class: BoxnetApi::Client
Constant Summary collapse
- @@API_KEY =
nil
- @@URL =
"https://www.box.net/api/1.0/rest"
Class Method Summary collapse
- .API_KEY=(value) ⇒ Object
- .get_account_tree(auth_token, folder_id, options = {}) ⇒ Object
- .get_auth_token(ticket) ⇒ Object
- .get_auth_url_for_ticket(ticket) ⇒ Object
- .get_ticket ⇒ Object
Class Method Details
.API_KEY=(value) ⇒ Object
10 11 12 |
# File 'lib/boxnet.rb', line 10 def self.API_KEY=(value) @@API_KEY = value end |
.get_account_tree(auth_token, folder_id, options = {}) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/boxnet.rb', line 27 def self.get_account_tree(auth_token, folder_id, ={}) params = [] params << "onelevel" if [:onelevel] params << "nozip" if params.empty? raw_result = get(@@URL + "?api_key=#{@@API_KEY}&action=get_account_tree&auth_token=#{auth_token}&folder_id=#{folder_id}") else params_string = params.join(",") raw_result = get(@@URL + "?api_key=#{@@API_KEY}&action=get_account_tree&auth_token=#{auth_token}&folder_id=#{folder_id}¶ms[]=#{params_string}") end Result.new(raw_result) end |
.get_auth_token(ticket) ⇒ Object
23 24 25 |
# File 'lib/boxnet.rb', line 23 def self.get_auth_token(ticket) get(@@URL + "?api_key=#{@@API_KEY}&ticket=#{ticket}&action=get_auth_token") end |
.get_auth_url_for_ticket(ticket) ⇒ Object
19 20 21 |
# File 'lib/boxnet.rb', line 19 def self.get_auth_url_for_ticket(ticket) "https://www.box.net/api/1.0/auth/#{ticket}" end |