Class: MuseumDay::Museum
- Inherits:
-
Object
- Object
- MuseumDay::Museum
- Defined in:
- lib/museum_day/museum.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#city ⇒ Object
Returns the value of attribute city.
-
#description ⇒ Object
Returns the value of attribute description.
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#fb ⇒ Object
Returns the value of attribute fb.
-
#hours ⇒ Object
Returns the value of attribute hours.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#twitter ⇒ Object
Returns the value of attribute twitter.
-
#url ⇒ Object
Returns the value of attribute url.
-
#website_url ⇒ Object
Returns the value of attribute website_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Museum
constructor
A new instance of Museum.
Constructor Details
#initialize(attributes) ⇒ Museum
Returns a new instance of Museum.
8 9 10 11 12 13 14 |
# File 'lib/museum_day/museum.rb', line 8 def initialize(attributes) @name = attributes[:name] @city = attributes[:city] @url = attributes[:url] @hours = attributes[:hours] @@all << self end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def address @address end |
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def city @city end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def description @description end |
#doc ⇒ Object
Returns the value of attribute doc.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def doc @doc end |
#fb ⇒ Object
Returns the value of attribute fb.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def fb @fb end |
#hours ⇒ Object
Returns the value of attribute hours.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def hours @hours end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def name @name end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def phone_number @phone_number end |
#twitter ⇒ Object
Returns the value of attribute twitter.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def twitter @twitter end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def url @url end |
#website_url ⇒ Object
Returns the value of attribute website_url.
3 4 5 |
# File 'lib/museum_day/museum.rb', line 3 def website_url @website_url end |
Class Method Details
.all ⇒ Object
16 17 18 |
# File 'lib/museum_day/museum.rb', line 16 def self.all @@all end |
.clear_all ⇒ Object
24 25 26 |
# File 'lib/museum_day/museum.rb', line 24 def self.clear_all @@all.clear end |
.find(id) ⇒ Object
20 21 22 |
# File 'lib/museum_day/museum.rb', line 20 def self.find(id) self.all[id-1] end |