Class: Lighthouse::Facilities::NearbyFacility

Inherits:
Common::Base
  • Object
show all
Includes:
ActiveModel::Serializers::JSON
Defined in:
lib/lighthouse/facilities/nearby_facility.rb

Instance Attribute Summary

Attributes inherited from Common::Base

#errors_hash, #metadata

Instance Method Summary collapse

Methods inherited from Common::Base

#changed, #changed?, #changes, default_sort, filterable_attributes, max_per_page, per_page, sortable_attributes

Constructor Details

#initialize(fac) ⇒ NearbyFacility

Returns a new instance of NearbyFacility.



16
17
18
19
20
21
22
# File 'lib/lighthouse/facilities/nearby_facility.rb', line 16

def initialize(fac)
  super(fac)

  self.id = fac['id']
  self.min_time = fac['attributes']['min_time']
  self.max_time = fac['attributes']['max_time']
end