Class: Previews::PackageReviews

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

Instance Method Summary collapse

Constructor Details

#initialize(locale, release, package) ⇒ PackageReviews

Returns a new instance of PackageReviews.



11
12
13
14
# File 'lib/previews.rb', line 11

def initialize(locale, release, package)
  @url    = "http://reviews.ubuntu.com/reviews/api/1.0/reviews/filter/#{locale}/ubuntu/#{release}/any/#{package}/"
  @reviews = []
end

Instance Method Details

#reviewsObject

Return Array of Hases



17
18
19
20
# File 'lib/previews.rb', line 17

def reviews
  download_reviews
  @reviews.flatten!
end