Class: ITunesAppReviews::Reviews

Inherits:
Object
  • Object
show all
Defined in:
lib/itunes_app_reviews/reviews.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(store_id, app_id) ⇒ Reviews

Returns a new instance of Reviews.



15
16
17
18
# File 'lib/itunes_app_reviews/reviews.rb', line 15

def initialize(store_id, app_id)
  @store_id = store_id
  @app_id = app_id
end

Instance Attribute Details

#start_date=(value) ⇒ Object (writeonly)

Sets the attribute start_date

Parameters:

  • value

    the value to set the attribute start_date to.



13
14
15
# File 'lib/itunes_app_reviews/reviews.rb', line 13

def start_date=(value)
  @start_date = value
end

Instance Method Details

#eachObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/itunes_app_reviews/reviews.rb', line 20

def each
  ITunesAppReviews::log.debug("Loading reviews (store_id: #{@store_id}, app_id: #{@app_id})")
  page = 0
  while true
    page += 1
    reviews = reviews_page(page)

    break if reviews.empty?

    reviews.each do |review|
      yield review
    end
  end
end