class Spaceship::Tunes::AppRatings

Represents app ratings from App Store Connect

Attributes

application[RW]

@return (Spaceship::Tunes::Application) A reference to the application

this version is for
five_star_rating_count[RW]

@return (Integer) total number of five star ratings recevied

four_star_rating_count[RW]

@return (Integer) total number of four star ratings recevied

one_star_rating_count[RW]

@return (Integer) total number of one star ratings recevied

rating_count[RW]

@return (Integer) total number of ratings recevied

three_star_rating_count[RW]

@return (Integer) total number of three star ratings recevied

two_star_rating_count[RW]

@return (Integer) total number of two star ratings recevied

Public Instance Methods

average_rating() click to toggle source

@return (Float) the average rating for this summary (rounded to 2 decimal places)

# File spaceship/lib/spaceship/tunes/app_ratings.rb, line 40
def average_rating
  ((one_star_rating_count +
    (two_star_rating_count * 2) +
    (three_star_rating_count * 3) +
    (four_star_rating_count * 4) +
    (five_star_rating_count * 5)) / rating_count.to_f).round(2)
end
reviews(store_front = '', version_id = '', upto_date = nil) click to toggle source

@return (Array) of Review Objects

# File spaceship/lib/spaceship/tunes/app_ratings.rb, line 49
def reviews(store_front = '', version_id = '', upto_date = nil)
  raw_reviews = client.get_reviews(application.apple_id, application.platform, store_front, version_id, upto_date)
  raw_reviews.map do |review|
    review["value"]["application"] = self.application
    AppReview.factory(review["value"])
  end
end