Class: Scouter::Pocket
- Inherits:
-
Base::Object
- Object
- Base::Object
- Scouter::Pocket
- Defined in:
- lib/scouter/pocket.rb
Constant Summary collapse
- END_POINT =
'https://widgets.getpocket.com'.freeze
Class Method Summary collapse
-
.get_count(urls) ⇒ Hashie::Mash, Array
Get Pocket Count.
-
.set_api_random(num) ⇒ Object
Set API parameter for test mock.
Methods included from Base::Connection
Class Method Details
.get_count(urls) ⇒ Hashie::Mash, Array
Get Pocket Count
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/scouter/pocket.rb', line 8 def self.get_count(urls) urls = check_and_trans_url(urls) results, errors = {}, [] urls.each_with_index do |u, idx| sleep(WAIT_SEC) if idx != 0 res, error = get_and_parse_response(u) errors << error && next if error results.merge!(res) end res_hash = Hashie::Mash.new(results) return [res_hash, errors] end |
.set_api_random(num) ⇒ Object
Set API parameter for test mock
23 24 25 |
# File 'lib/scouter/pocket.rb', line 23 def self.set_api_random(num) @@api_rand_num = num end |