Class: LunarCalendar::Lunar

Inherits:
Date
  • Object
show all
Defined in:
lib/lunar_calendar/lunar.rb

Overview

The Lunar Calendar Date

Instance Attribute Summary

Attributes inherited from Date

#day, #month, #year

Instance Method Summary collapse

Methods inherited from Date

#<=>, #==, #binary, #to_i

Constructor Details

#initialize(year, month, day, leap = false) ⇒ Lunar

Returns a new instance of Lunar.

Parameters:

  • year (Number)

    year

  • month (Number)

    month

  • day (Number)

    day

  • leap (Boolean) (defaults to: false)

    is leap month

Since:

  • 0.1.0



14
15
16
17
# File 'lib/lunar_calendar/lunar.rb', line 14

def initialize(year, month, day, leap = false)
  super(year, month, day)
  @leap = leap
end

Instance Method Details

#leap?Boolean

Returns is leap month.

Returns:

  • (Boolean)

    is leap month

Since:

  • 0.1.0



22
23
24
# File 'lib/lunar_calendar/lunar.rb', line 22

def leap?
  @leap == true
end