Class: NYCTheaterDiscounts::Vendor

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, path) ⇒ Vendor

Returns a new instance of Vendor.



10
11
12
13
14
15
# File 'lib/nyc_theater_discounts/vendor.rb', line 10

def initialize(name, path)
  @name = name
  @url = path
  @shows = []
  @@all << self
end

Instance Attribute Details

#lowest_priceObject

Returns the value of attribute lowest_price.



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

def lowest_price
  @lowest_price
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#showsObject

Returns the value of attribute shows.



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

def shows
  @shows
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

Class Method Details

.allObject



17
18
19
20
21
22
23
# File 'lib/nyc_theater_discounts/vendor.rb', line 17

def self.all
   if @@all.uniq == @@all
    @@all
  else
    @@all.uniq!
  end
end