Class: NYCTheaterDiscounts::Show
- Inherits:
-
Object
- Object
- NYCTheaterDiscounts::Show
- Defined in:
- lib/nyc_theater_discounts/show.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#deal_url ⇒ Object
Returns the value of attribute deal_url.
-
#name ⇒ Object
Returns the value of attribute name.
-
#price ⇒ Object
Returns the value of attribute price.
-
#vendor ⇒ Object
Returns the value of attribute vendor.
Class Method Summary collapse
Instance Method Summary collapse
- #find_by_name(nameval) ⇒ Object
-
#initialize(show_name, show_price, url) ⇒ Show
constructor
A new instance of Show.
- #vendors ⇒ Object
Constructor Details
#initialize(show_name, show_price, url) ⇒ Show
Returns a new instance of Show.
10 11 12 13 14 15 16 |
# File 'lib/nyc_theater_discounts/show.rb', line 10 def initialize(show_name, show_price, url) @name = show_name @price = show_price @deal_url = url @vendors = [] @@all << self end |
Instance Attribute Details
#deal_url ⇒ Object
Returns the value of attribute deal_url.
6 7 8 |
# File 'lib/nyc_theater_discounts/show.rb', line 6 def deal_url @deal_url end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/nyc_theater_discounts/show.rb', line 6 def name @name end |
#price ⇒ Object
Returns the value of attribute price.
6 7 8 |
# File 'lib/nyc_theater_discounts/show.rb', line 6 def price @price end |
#vendor ⇒ Object
Returns the value of attribute vendor.
6 7 8 |
# File 'lib/nyc_theater_discounts/show.rb', line 6 def vendor @vendor end |
Class Method Details
.all ⇒ Object
19 20 21 |
# File 'lib/nyc_theater_discounts/show.rb', line 19 def self.all @@all end |
Instance Method Details
#find_by_name(nameval) ⇒ Object
27 28 29 |
# File 'lib/nyc_theater_discounts/show.rb', line 27 def find_by_name(nameval) self.all.detect{|a| a.name == nameval} end |
#vendors ⇒ Object
23 24 25 |
# File 'lib/nyc_theater_discounts/show.rb', line 23 def vendors @vendors end |