⌚ OpenOpeningstijden main server application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

node.rb 675B

1234567891011121314151617181920212223242526
  1. # frozen_string_literal: true
  2. require 'opening_hours_converter'
  3. module Hours
  4. module Models
  5. ##
  6. # A Node is a readonly model for querying the projection of "places".
  7. # * Readonly: it is not enforced on model or ORM level, but should be
  8. # enforced in the database-server and user setup. RO only means that
  9. # this model is only tested and optimized against reading.
  10. class Node < Sequel::Model(::Hours.projections_database[:query_nodes])
  11. def lat
  12. location.lat
  13. end
  14. def lon
  15. location.lon
  16. end
  17. def status
  18. OpeningHoursConverter::Iterator.new.is_opened?(opening_hours)
  19. end
  20. end
  21. end
  22. end