Class: PopularDeals::NewDeals
- Inherits:
-
Object
- Object
- PopularDeals::NewDeals
- Defined in:
- lib/popular_deals/newdeals.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#deal_rating ⇒ Object
Returns the value of attribute deal_rating.
-
#discription ⇒ Object
Returns the value of attribute discription.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#posted ⇒ Object
Returns the value of attribute posted.
-
#price ⇒ Object
Returns the value of attribute price.
-
#purchase ⇒ Object
Returns the value of attribute purchase.
-
#purchase_link ⇒ Object
Returns the value of attribute purchase_link.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#deal_rating ⇒ Object
Returns the value of attribute deal_rating.
4 5 6 |
# File 'lib/popular_deals/newdeals.rb', line 4 def @deal_rating end |
#discription ⇒ Object
Returns the value of attribute discription.
4 5 6 |
# File 'lib/popular_deals/newdeals.rb', line 4 def discription @discription end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/popular_deals/newdeals.rb', line 4 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
4 5 6 |
# File 'lib/popular_deals/newdeals.rb', line 4 def number @number end |
#posted ⇒ Object
Returns the value of attribute posted.
4 5 6 |
# File 'lib/popular_deals/newdeals.rb', line 4 def posted @posted end |
#price ⇒ Object
Returns the value of attribute price.
4 5 6 |
# File 'lib/popular_deals/newdeals.rb', line 4 def price @price end |
#purchase ⇒ Object
Returns the value of attribute purchase.
4 5 6 |
# File 'lib/popular_deals/newdeals.rb', line 4 def purchase @purchase end |
#purchase_link ⇒ Object
Returns the value of attribute purchase_link.
4 5 6 |
# File 'lib/popular_deals/newdeals.rb', line 4 def purchase_link @purchase_link end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/popular_deals/newdeals.rb', line 4 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/popular_deals/newdeals.rb', line 4 def url @url end |
Class Method Details
.all ⇒ Object
11 12 13 |
# File 'lib/popular_deals/newdeals.rb', line 11 def self.all @@all end |
.deals ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/popular_deals/newdeals.rb', line 22 def self.deals all_deals = @@all deals = [] all_deals.collect do |deal_info| deal_info.number = all_deals.index(deal_info).to_i + 1 deals << deal_info end deals end |
.open_deal_page(base_url, input) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/popular_deals/newdeals.rb', line 15 def self.open_deal_page(base_url, input) index = input.to_i - 1 deals = self.all product_url = "#{deals[index].url}" product_url end |
Instance Method Details
#save ⇒ Object
7 8 9 |
# File 'lib/popular_deals/newdeals.rb', line 7 def save @@all << self end |