Sha256: d359ee3ee7f2c42c429394830c12ab2375c4d47f513238bd751cf3f19f17cf14

Contents?: true

Size: 563 Bytes

Versions: 13

Compression:

Stored size: 563 Bytes

Contents

require "solareventcalculator"

module Tlapse
  module SolarEvent
    LAT  = 35.779590
    LON  = -78.638179
    TZ   = "America/New_York"

    def self.sunrise
      s = solar_event.compute_official_sunrise(TZ)
      n = Time.new
      Time.new(n.year, n.month, n.day, s.hour, s.minute)
    end

    def self.sunset
      s = solar_event.compute_official_sunset(TZ)
      n = Time.new
      Time.new(n.year, n.month, n.day, s.hour, s.minute)
    end

    def self.solar_event
      date = Date.new
      SolarEventCalculator.new date, LAT, LON
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
tlapse-0.7.0 lib/tlapse/solar_event.rb
tlapse-0.6.3 lib/tlapse/solar_event.rb
tlapse-0.6.2 lib/tlapse/solar_event.rb
tlapse-0.6.1 lib/tlapse/solar_event.rb
tlapse-0.6.0 lib/tlapse/solar_event.rb
tlapse-0.5.1 lib/tlapse/solar_event.rb
tlapse-0.5.0 lib/tlapse/solar_event.rb
tlapse-0.4.1 lib/tlapse/solar_event.rb
tlapse-0.4.0 lib/tlapse/solar_event.rb
tlapse-0.3.3 lib/tlapse/solar_event.rb
tlapse-0.3.2 lib/tlapse/solar_event.rb
tlapse-0.3.1 lib/tlapse/solar_event.rb
tlapse-0.3.0 lib/tlapse/solar_event.rb