Module: FiscalDate::ComparableExt
- Included in:
- FiscalDate
- Defined in:
- lib/fiscal_date/comparable_ext.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/fiscal_date/comparable_ext.rb', line 4 def self.included(base) base.send(:include, Comparable) end |
Instance Method Details
#<=>(fd) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/fiscal_date/comparable_ext.rb', line 8 def <=>(fd) if year < fd.year || (year == fd.year && quarter < fd.quarter) -1 elsif year > fd.year || (year == fd.year && quarter > fd.quarter) 1 else 0 end end |