Class: CoffeeBreak::Beans
- Inherits:
-
Object
- Object
- CoffeeBreak::Beans
- Defined in:
- lib/beans.rb
Constant Summary collapse
- @@all =
Stores every instance of Beans and anything collected from scrape methods will display in CLI.
[]
Instance Attribute Summary collapse
-
#details ⇒ Object
Display collection of coffee with corresponding attributes.
-
#label ⇒ Object
Display collection of coffee with corresponding attributes.
-
#link ⇒ Object
Display collection of coffee with corresponding attributes.
-
#name ⇒ Object
Display collection of coffee with corresponding attributes.
-
#price ⇒ Object
Display collection of coffee with corresponding attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, label, price, link, details = nil) ⇒ Beans
constructor
A new instance of Beans.
Constructor Details
#initialize(name, label, price, link, details = nil) ⇒ Beans
Returns a new instance of Beans.
13 14 15 16 17 18 19 20 |
# File 'lib/beans.rb', line 13 def initialize(name, label, price, link, details=nil) @name = name @label = label @price = price @details = details @link = link @@all << self end |
Instance Attribute Details
#details ⇒ Object
Display collection of coffee with corresponding attributes
7 8 9 |
# File 'lib/beans.rb', line 7 def details @details end |
#label ⇒ Object
Display collection of coffee with corresponding attributes
7 8 9 |
# File 'lib/beans.rb', line 7 def label @label end |
#link ⇒ Object
Display collection of coffee with corresponding attributes
7 8 9 |
# File 'lib/beans.rb', line 7 def link @link end |
#name ⇒ Object
Display collection of coffee with corresponding attributes
7 8 9 |
# File 'lib/beans.rb', line 7 def name @name end |
#price ⇒ Object
Display collection of coffee with corresponding attributes
7 8 9 |
# File 'lib/beans.rb', line 7 def price @price end |
Class Method Details
.all ⇒ Object
22 23 24 |
# File 'lib/beans.rb', line 22 def self.all @@all end |