Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class VideoPricer
- def price(imdbId)
- price = 4.95
- rating = ImdbRatings.new().fetchRating(imdbId)
- #premium title
- if(rating >= 8.0)
- price += 1.0
- end
- #bargain bucket
- if(rating < 4.0)
- price -= 1.0
- end
- return price
- end
- end
- class ImdbRatings
- def fetchRating(imdbId)
- # code to get rating from IMDB API
- end
- end
Add Comment
Please, Sign In to add comment