Class: Stew::Store::AppOffers

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/stew/store/app_offers.rb

Overview

The offers of an application

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ AppOffers

Returns a new instance of AppOffers.



8
9
10
# File 'lib/stew/store/app_offers.rb', line 8

def initialize(node)
  @app_offers = node.css("div.game_area_purchase_game").map {|item| AppOffer.create(item)}
end

Instance Method Details

#each(&block) ⇒ Object



12
13
14
# File 'lib/stew/store/app_offers.rb', line 12

def each(&block)
  @app_offers.each {|item| yield item}
end

#sale?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/stew/store/app_offers.rb', line 16

def sale?
  sales.count != 0
end

#salesObject



20
21
22
# File 'lib/stew/store/app_offers.rb', line 20

def sales
  @app_offers.select {|item| item.sale?}
end