Class: SlickdealsCli::Popular
- Inherits:
-
Object
- Object
- SlickdealsCli::Popular
- Defined in:
- lib/slickdeals_cli/popular.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#seller ⇒ Object
Returns the value of attribute seller.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(deal_hash) ⇒ Popular
constructor
A new instance of Popular.
Constructor Details
#initialize(deal_hash) ⇒ Popular
Returns a new instance of Popular.
6 7 8 9 |
# File 'lib/slickdeals_cli/popular.rb', line 6 def initialize(deal_hash) deal_hash.each {|attr, value| self.send(("#{attr}="),value)} @@all << self end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/slickdeals_cli/popular.rb', line 2 def name @name end |
#seller ⇒ Object
Returns the value of attribute seller.
2 3 4 |
# File 'lib/slickdeals_cli/popular.rb', line 2 def seller @seller end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/slickdeals_cli/popular.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
17 18 19 |
# File 'lib/slickdeals_cli/popular.rb', line 17 def self.all @@all end |
.create_popular_deal(pop_slick) ⇒ Object
11 12 13 14 15 |
# File 'lib/slickdeals_cli/popular.rb', line 11 def self.create_popular_deal(pop_slick) pop_slick.each do |deal_hash| self.new(deal_hash) end end |