Class: Itch::Reviews
- Inherits:
-
Object
- Object
- Itch::Reviews
- Includes:
- Request, RequireAuth, SimpleInspect
- Defined in:
- lib/itch/reviews.rb
Overview
Fetch reviews
Instance Method Summary collapse
-
#initialize(agent, game_id) ⇒ Reviews
constructor
A new instance of Reviews.
- #list ⇒ Object
Methods included from Request
Methods included from RequireAuth
Methods included from SimpleInspect
#exclude_inspection, #inspect, #pretty_print_instance_variables
Constructor Details
#initialize(agent, game_id) ⇒ Reviews
Returns a new instance of Reviews.
17 18 19 20 |
# File 'lib/itch/reviews.rb', line 17 def initialize(agent, game_id) @agent = agent @game_id = game_id end |
Instance Method Details
#list ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/itch/reviews.rb', line 22 def list all_reviews = [] page_number = 1 loop do page_reviews = parse_page_reviews(page_number) break if page_reviews.empty? all_reviews += page_reviews page_number += 1 sleep 0.5 end all_reviews end |