Module: Daylight
- Defined in:
- lib/trigger_switch_d/daylight.rb
Overview
External referenses used: www.stjarnhimlen.se (accessed 2010-03-02) users.electromagnetic.net/bu/astro/sunrise-set.php (accessed 2010-03-02) www.astro.uu.nl/~strous/AA/en/reken/zonpositie.html (accessed 2010-03-02)
Defined Under Namespace
Modules: DayFloat
Constant Summary collapse
- JULIAN_DAYS_UNTIL_YEAR_2000 =
:nodoc:all
2451545.0
- UNIT_CIRCLE =
360.0
- C1 =
0.0009
- C2 =
357.5291
- C3 =
0.98560028
- C4 =
1.9148
- C5 =
0.0200
- C6 =
0.0003
- C7 =
102.9372
- C8 =
0.0053
- C9 =
0.0069
- C10 =
23.45
- C11 =
-0.83
- FOR =
{:sunrise => -1, :sunset => 1}
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(receiver) ⇒ Object
40 41 42 43 |
# File 'lib/trigger_switch_d/daylight.rb', line 40 def self.extended(receiver) days = receiver.jd raise "method jd on #{receiver} does not return Fixnum" unless days.kind_of? Fixnum end |
Instance Method Details
#__prepare_float__ ⇒ Object
99 100 101 102 103 |
# File 'lib/trigger_switch_d/daylight.rb', line 99 def __prepare_float__ Float.class_eval {include DayFloat} def __prepare_float__ end end |
#sunrise(at_location) ⇒ Object
45 46 47 |
# File 'lib/trigger_switch_d/daylight.rb', line 45 def sunrise(at_location) time_for(:sunrise,at_location) end |
#sunset(at_location) ⇒ Object
49 50 51 |
# File 'lib/trigger_switch_d/daylight.rb', line 49 def sunset(at_location) time_for(:sunset,at_location) end |