Class: Amzwish::Wishlist
- Inherits:
-
Object
- Object
- Amzwish::Wishlist
- Includes:
- Enumerable
- Defined in:
- lib/amzwish/wishlist.rb
Defined Under Namespace
Classes: Page
Instance Method Summary collapse
- #books ⇒ Object
- #each ⇒ Object (also: #each_book)
-
#initialize(email, website = Services::WebsiteWrapper.new) ⇒ Wishlist
constructor
A new instance of Wishlist.
Constructor Details
#initialize(email, website = Services::WebsiteWrapper.new) ⇒ Wishlist
Returns a new instance of Wishlist.
5 6 7 8 |
# File 'lib/amzwish/wishlist.rb', line 5 def initialize(email, website = Services::WebsiteWrapper.new) @email = email @website = website end |
Instance Method Details
#books ⇒ Object
10 11 12 |
# File 'lib/amzwish/wishlist.rb', line 10 def books to_a end |
#each ⇒ Object Also known as: each_book
14 15 16 17 |
# File 'lib/amzwish/wishlist.rb', line 14 def each lists = @website.find_for(@email) each_page(lists[0][:id]){|p| p.books.each{|b| yield b}} end |