Class: CtGov::Location
- Inherits:
-
Object
- Object
- CtGov::Location
- Defined in:
- lib/ct_gov/location.rb
Instance Method Summary collapse
- #contact ⇒ Object
- #contact_backup ⇒ Object
- #facility ⇒ Object
-
#initialize(raw_location) ⇒ Location
constructor
A new instance of Location.
- #investigators ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(raw_location) ⇒ Location
Returns a new instance of Location.
4 5 6 |
# File 'lib/ct_gov/location.rb', line 4 def initialize(raw_location) @raw_location = raw_location end |
Instance Method Details
#contact ⇒ Object
8 9 10 |
# File 'lib/ct_gov/location.rb', line 8 def contact Contact.new(@raw_location['contact']) unless @raw_location['contact'].nil? end |
#contact_backup ⇒ Object
12 13 14 |
# File 'lib/ct_gov/location.rb', line 12 def contact_backup Contact.new(@raw_location['contact_backup']) unless @raw_location['contact_backup'].nil? end |
#facility ⇒ Object
16 17 18 |
# File 'lib/ct_gov/location.rb', line 16 def facility Facility.new(@raw_location['facility']) unless @raw_location['facility'].nil? end |
#investigators ⇒ Object
20 21 22 23 24 |
# File 'lib/ct_gov/location.rb', line 20 def investigators [@raw_location['investigator']].flatten.map do |investigator| Investigator.new(investigator) unless investigator.nil? end end |
#status ⇒ Object
26 27 28 |
# File 'lib/ct_gov/location.rb', line 26 def status @raw_location['status'] end |