Class: Guitar
- Inherits:
-
Object
- Object
- Guitar
- Defined in:
- lib/fender_guitar_catalogue/guitar.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#model ⇒ Object
Returns the value of attribute model.
-
#price ⇒ Object
Returns the value of attribute price.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(details) ⇒ Guitar
constructor
A new instance of Guitar.
- #item_desc ⇒ Object
Constructor Details
#initialize(details) ⇒ Guitar
Returns a new instance of Guitar.
6 7 8 9 10 11 |
# File 'lib/fender_guitar_catalogue/guitar.rb', line 6 def initialize(details) details.each do |key, value| send("#{key}=", value) end @@all << self end |
Instance Attribute Details
#model ⇒ Object
Returns the value of attribute model.
2 3 4 |
# File 'lib/fender_guitar_catalogue/guitar.rb', line 2 def model @model end |
#price ⇒ Object
Returns the value of attribute price.
2 3 4 |
# File 'lib/fender_guitar_catalogue/guitar.rb', line 2 def price @price end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/fender_guitar_catalogue/guitar.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
22 23 24 |
# File 'lib/fender_guitar_catalogue/guitar.rb', line 22 def self.all @@all end |
Instance Method Details
#item_desc ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/fender_guitar_catalogue/guitar.rb', line 13 def item_desc puts "===#{@model.upcase}===" Scraper.new.scrape_content(@url) puts "" puts "~Price (AUD)~" puts "" puts @price end |