Class: PHLCovidTesting::TestingLocation

Inherits:
Object
  • Object
show all
Includes:
Displayable::InstanceMethods, Findable::InstanceMethods, Inputable::InstanceMethods
Defined in:
lib/phl_covid_testing/testing_location.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Inputable::InstanceMethods

#get_input_all, #get_input_main, #get_input_main_options, #get_input_sub

Methods included from Displayable::InstanceMethods

#display_all, #display_detail

Methods included from Findable::InstanceMethods

#search_by_access, #search_by_name, #search_by_name_or_zipcode, #search_by_zipcode

Constructor Details

#initialize(hash) ⇒ TestingLocation

Returns a new instance of TestingLocation.



10
11
12
13
14
15
# File 'lib/phl_covid_testing/testing_location.rb', line 10

def initialize(hash)
    hash.each do |k, v|
        self.send(("#{k}="), v)
    end
    @@all << self
end

Instance Attribute Details

#access_typeObject

Returns the value of attribute access_type.



2
3
4
# File 'lib/phl_covid_testing/testing_location.rb', line 2

def access_type
  @access_type
end

#addressObject

Returns the value of attribute address.



2
3
4
# File 'lib/phl_covid_testing/testing_location.rb', line 2

def address
  @address
end

#facility_typeObject

Returns the value of attribute facility_type.



2
3
4
# File 'lib/phl_covid_testing/testing_location.rb', line 2

def facility_type
  @facility_type
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/phl_covid_testing/testing_location.rb', line 2

def name
  @name
end

#phoneObject

Returns the value of attribute phone.



2
3
4
# File 'lib/phl_covid_testing/testing_location.rb', line 2

def phone
  @phone
end

#referralObject

Returns the value of attribute referral.



2
3
4
# File 'lib/phl_covid_testing/testing_location.rb', line 2

def referral
  @referral
end

#streetObject

Returns the value of attribute street.



2
3
4
# File 'lib/phl_covid_testing/testing_location.rb', line 2

def street
  @street
end

#zipcodeObject

Returns the value of attribute zipcode.



2
3
4
# File 'lib/phl_covid_testing/testing_location.rb', line 2

def zipcode
  @zipcode
end

Class Method Details

.allObject



23
24
25
# File 'lib/phl_covid_testing/testing_location.rb', line 23

def self.all
    @@all 
end

.create_from_collection(array) ⇒ Object



17
18
19
20
21
# File 'lib/phl_covid_testing/testing_location.rb', line 17

def self.create_from_collection(array)
    array.each do |hash|
      PHLCovidTesting::TestingLocation.new(hash)
    end
end