Class: SteamDailyDeals::Deal
- Inherits:
-
Object
- Object
- SteamDailyDeals::Deal
- Defined in:
- lib/steam_daily_deals/deal.rb
Overview
Deal Class
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#app_url ⇒ Object
Returns the value of attribute app_url.
-
#availibility ⇒ Object
Returns the value of attribute availibility.
-
#description ⇒ Object
Returns the value of attribute description.
-
#final_price ⇒ Object
Returns the value of attribute final_price.
-
#name ⇒ Object
Returns the value of attribute name.
-
#overall_rating ⇒ Object
Returns the value of attribute overall_rating.
-
#popular_tags ⇒ Object
Returns the value of attribute popular_tags.
-
#recent_rating ⇒ Object
Returns the value of attribute recent_rating.
-
#recent_reviews ⇒ Object
Returns the value of attribute recent_reviews.
-
#release_date ⇒ Object
Returns the value of attribute release_date.
-
#total_reviews ⇒ Object
Returns the value of attribute total_reviews.
Class Method Summary collapse
Instance Method Summary collapse
- #add_deal_information(deal_info) ⇒ Object
-
#initialize(deal) ⇒ Deal
constructor
A new instance of Deal.
Constructor Details
#initialize(deal) ⇒ Deal
Returns a new instance of Deal.
17 18 19 20 21 22 23 |
# File 'lib/steam_daily_deals/deal.rb', line 17 def initialize(deal) deal.each do |key, value| send("#{key}=", value) end @@all << self end |
Instance Attribute Details
#app_url ⇒ Object
Returns the value of attribute app_url.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def app_url @app_url end |
#availibility ⇒ Object
Returns the value of attribute availibility.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def availibility @availibility end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def description @description end |
#final_price ⇒ Object
Returns the value of attribute final_price.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def final_price @final_price end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def name @name end |
#overall_rating ⇒ Object
Returns the value of attribute overall_rating.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def @overall_rating end |
#popular_tags ⇒ Object
Returns the value of attribute popular_tags.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def @popular_tags end |
#recent_rating ⇒ Object
Returns the value of attribute recent_rating.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def @recent_rating end |
#recent_reviews ⇒ Object
Returns the value of attribute recent_reviews.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def recent_reviews @recent_reviews end |
#release_date ⇒ Object
Returns the value of attribute release_date.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def release_date @release_date end |
#total_reviews ⇒ Object
Returns the value of attribute total_reviews.
3 4 5 |
# File 'lib/steam_daily_deals/deal.rb', line 3 def total_reviews @total_reviews end |
Class Method Details
.all ⇒ Object
39 40 41 |
# File 'lib/steam_daily_deals/deal.rb', line 39 def self.all @@all end |
.create_from_collection(deals) ⇒ Object
25 26 27 |
# File 'lib/steam_daily_deals/deal.rb', line 25 def self.create_from_collection(deals) deals.each { |deal| new(deal) } end |
.find_deal(index) ⇒ Object
29 30 31 |
# File 'lib/steam_daily_deals/deal.rb', line 29 def self.find_deal(index) self.all[index - 1] end |
Instance Method Details
#add_deal_information(deal_info) ⇒ Object
33 34 35 36 37 |
# File 'lib/steam_daily_deals/deal.rb', line 33 def add_deal_information(deal_info) deal_info.each do |key, value| send("#{key}=", value) end end |