Class: BroadwayNow::Show
- Inherits:
-
Object
- Object
- BroadwayNow::Show
- Defined in:
- lib/broadway_now/show.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#name ⇒ Object
, :cast.
-
#price ⇒ Object
, :cast.
-
#running_time ⇒ Object
, :cast.
-
#story ⇒ Object
, :cast.
-
#theater ⇒ Object
, :cast.
-
#url ⇒ Object
, :cast.
Class Method Summary collapse
Instance Method Summary collapse
- #add_info(extra_info_hash) ⇒ Object
-
#initialize(hash_attributes) ⇒ Show
constructor
A new instance of Show.
Constructor Details
#initialize(hash_attributes) ⇒ Show
Returns a new instance of Show.
5 6 7 |
# File 'lib/broadway_now/show.rb', line 5 def initialize(hash_attributes) hash_attributes.each {|key,value| self.send(("#{key}="), value)} end |
Instance Attribute Details
#name ⇒ Object
, :cast
2 3 4 |
# File 'lib/broadway_now/show.rb', line 2 def name @name end |
#price ⇒ Object
, :cast
2 3 4 |
# File 'lib/broadway_now/show.rb', line 2 def price @price end |
#running_time ⇒ Object
, :cast
2 3 4 |
# File 'lib/broadway_now/show.rb', line 2 def running_time @running_time end |
#story ⇒ Object
, :cast
2 3 4 |
# File 'lib/broadway_now/show.rb', line 2 def story @story end |
#theater ⇒ Object
, :cast
2 3 4 |
# File 'lib/broadway_now/show.rb', line 2 def theater @theater end |
#url ⇒ Object
, :cast
2 3 4 |
# File 'lib/broadway_now/show.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
20 21 22 |
# File 'lib/broadway_now/show.rb', line 20 def self.all @@all end |
.create_shows(shows_array) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/broadway_now/show.rb', line 9 def self.create_shows(shows_array) shows_array.each do |hash_attributes| show = self.new(hash_attributes) @@all << show end end |
Instance Method Details
#add_info(extra_info_hash) ⇒ Object
16 17 18 |
# File 'lib/broadway_now/show.rb', line 16 def add_info(extra_info_hash) extra_info_hash.each {|key,value| self.send(("#{key}="),value)} end |