Class: NYCTheaterDiscounts::Show

Inherits:
Object
  • Object
show all
Defined in:
lib/nyc_theater_discounts/show.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_urlObject

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

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/nyc_theater_discounts/show.rb', line 6

def name
  @name
end

#priceObject

Returns the value of attribute price.



6
7
8
# File 'lib/nyc_theater_discounts/show.rb', line 6

def price
  @price
end

#vendorObject

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

.allObject



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

#vendorsObject



23
24
25
# File 'lib/nyc_theater_discounts/show.rb', line 23

def vendors
  @vendors
end