Class: MuseumDay::Museum

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#addressObject

Returns the value of attribute address.



3
4
5
# File 'lib/museum_day/museum.rb', line 3

def address
  @address
end

#cityObject

Returns the value of attribute city.



3
4
5
# File 'lib/museum_day/museum.rb', line 3

def city
  @city
end

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/museum_day/museum.rb', line 3

def description
  @description
end

#docObject

Returns the value of attribute doc.



3
4
5
# File 'lib/museum_day/museum.rb', line 3

def doc
  @doc
end

#fbObject

Returns the value of attribute fb.



3
4
5
# File 'lib/museum_day/museum.rb', line 3

def fb
  @fb
end

#hoursObject

Returns the value of attribute hours.



3
4
5
# File 'lib/museum_day/museum.rb', line 3

def hours
  @hours
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/museum_day/museum.rb', line 3

def name
  @name
end

#phone_numberObject

Returns the value of attribute phone_number.



3
4
5
# File 'lib/museum_day/museum.rb', line 3

def phone_number
  @phone_number
end

#twitterObject

Returns the value of attribute twitter.



3
4
5
# File 'lib/museum_day/museum.rb', line 3

def twitter
  @twitter
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/museum_day/museum.rb', line 3

def url
  @url
end

#website_urlObject

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

.allObject



16
17
18
# File 'lib/museum_day/museum.rb', line 16

def self.all
  @@all
end

.clear_allObject



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