Class: Astronoby::TwilightEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/astronoby/events/twilight_event.rb

Overview

Holds twilight times (civil, nautical, astronomical) for a single day.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(morning_civil_twilight_time: nil, evening_civil_twilight_time: nil, morning_nautical_twilight_time: nil, evening_nautical_twilight_time: nil, morning_astronomical_twilight_time: nil, evening_astronomical_twilight_time: nil) ⇒ TwilightEvent

Returns a new instance of TwilightEvent.

Parameters:

  • morning_civil_twilight_time (Time, nil) (defaults to: nil)
  • evening_civil_twilight_time (Time, nil) (defaults to: nil)
  • morning_nautical_twilight_time (Time, nil) (defaults to: nil)
  • evening_nautical_twilight_time (Time, nil) (defaults to: nil)
  • morning_astronomical_twilight_time (Time, nil) (defaults to: nil)
  • evening_astronomical_twilight_time (Time, nil) (defaults to: nil)


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/astronoby/events/twilight_event.rb', line 30

def initialize(
  morning_civil_twilight_time: nil,
  evening_civil_twilight_time: nil,
  morning_nautical_twilight_time: nil,
  evening_nautical_twilight_time: nil,
  morning_astronomical_twilight_time: nil,
  evening_astronomical_twilight_time: nil
)
  @morning_civil_twilight_time = morning_civil_twilight_time
  @evening_civil_twilight_time = evening_civil_twilight_time
  @morning_nautical_twilight_time = morning_nautical_twilight_time
  @evening_nautical_twilight_time = evening_nautical_twilight_time
  @morning_astronomical_twilight_time = morning_astronomical_twilight_time
  @evening_astronomical_twilight_time = evening_astronomical_twilight_time
end

Instance Attribute Details

#evening_astronomical_twilight_timeTime? (readonly)

Returns evening astronomical twilight time.

Returns:

  • (Time, nil)

    evening astronomical twilight time



22
23
24
# File 'lib/astronoby/events/twilight_event.rb', line 22

def evening_astronomical_twilight_time
  @evening_astronomical_twilight_time
end

#evening_civil_twilight_timeTime? (readonly)

Returns evening civil twilight time.

Returns:

  • (Time, nil)

    evening civil twilight time



10
11
12
# File 'lib/astronoby/events/twilight_event.rb', line 10

def evening_civil_twilight_time
  @evening_civil_twilight_time
end

#evening_nautical_twilight_timeTime? (readonly)

Returns evening nautical twilight time.

Returns:

  • (Time, nil)

    evening nautical twilight time



16
17
18
# File 'lib/astronoby/events/twilight_event.rb', line 16

def evening_nautical_twilight_time
  @evening_nautical_twilight_time
end

#morning_astronomical_twilight_timeTime? (readonly)

Returns morning astronomical twilight time.

Returns:

  • (Time, nil)

    morning astronomical twilight time



19
20
21
# File 'lib/astronoby/events/twilight_event.rb', line 19

def morning_astronomical_twilight_time
  @morning_astronomical_twilight_time
end

#morning_civil_twilight_timeTime? (readonly)

Returns morning civil twilight time.

Returns:

  • (Time, nil)

    morning civil twilight time



7
8
9
# File 'lib/astronoby/events/twilight_event.rb', line 7

def morning_civil_twilight_time
  @morning_civil_twilight_time
end

#morning_nautical_twilight_timeTime? (readonly)

Returns morning nautical twilight time.

Returns:

  • (Time, nil)

    morning nautical twilight time



13
14
15
# File 'lib/astronoby/events/twilight_event.rb', line 13

def morning_nautical_twilight_time
  @morning_nautical_twilight_time
end