Class: Urgentcare::Office

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, url = nil, next_available = nil, phone_number = nil) ⇒ Office

Returns a new instance of Office.



7
8
9
10
11
12
13
# File 'lib/UrgentCare/Office.rb', line 7

def initialize(name = nil, url = nil, next_available = nil, phone_number = nil)
  @name = name
  @url = url
  @next_available = next_available
  @phone_number = phone_number
  self.class.all << self #the class of this instance. abstracted away use of variable. 
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/UrgentCare/Office.rb', line 3

def name
  @name
end

#next_availableObject

Returns the value of attribute next_available.



3
4
5
# File 'lib/UrgentCare/Office.rb', line 3

def next_available
  @next_available
end

#phone_numberObject

Returns the value of attribute phone_number.



3
4
5
# File 'lib/UrgentCare/Office.rb', line 3

def phone_number
  @phone_number
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/UrgentCare/Office.rb', line 3

def url
  @url
end

Class Method Details

.allObject



15
16
17
# File 'lib/UrgentCare/Office.rb', line 15

def self.all
  @@all
end