Class: Stew::Store::Sale
- Inherits:
-
Object
- Object
- Stew::Store::Sale
- Defined in:
- lib/stew/store/sale.rb
Overview
A single sale in the Steam Store
Instance Method Summary collapse
- #app_id ⇒ Object
-
#initialize(node) ⇒ Sale
constructor
A new instance of Sale.
- #name ⇒ Object
- #original_price ⇒ Object
- #price ⇒ Object
Constructor Details
#initialize(node) ⇒ Sale
Returns a new instance of Sale.
5 6 7 |
# File 'lib/stew/store/sale.rb', line 5 def initialize(node) @node = node end |
Instance Method Details
#app_id ⇒ Object
23 24 25 |
# File 'lib/stew/store/sale.rb', line 23 def app_id @node.to_s.match(/tab_row_Discounts_([0-9]+)/)[1].to_i end |
#name ⇒ Object
9 10 11 |
# File 'lib/stew/store/sale.rb', line 9 def name @node.at_css("div.tab_desc").at_css("h4").content end |