Class: MonthRange::Month::Infinity

Inherits:
Numeric
  • Object
show all
Defined in:
lib/month_range/month.rb

Instance Method Summary collapse

Instance Method Details

#<=(other) ⇒ Object



31
32
33
# File 'lib/month_range/month.rb', line 31

def <=(other)
  other.infinite?
end

#<=>(other) ⇒ Object



47
48
49
50
51
52
53
54
55
# File 'lib/month_range/month.rb', line 47

def <=>(other)
  case other
  when Infinity
    return 1
  when MonthRange::Month
    return 1
  end
  nil
end

#==(other) ⇒ Object



39
40
41
# File 'lib/month_range/month.rb', line 39

def ==(other)
  other.infinite?
end

#>=(other) ⇒ Object



35
36
37
# File 'lib/month_range/month.rb', line 35

def >=(other)
  other.infinite? ? true : other.is_a?(MonthRange::Month)
end

#infinite?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/month_range/month.rb', line 27

def infinite?
  true
end

#to_dateObject



43
44
45
# File 'lib/month_range/month.rb', line 43

def to_date
  nil
end

#to_fObject



57
58
59
# File 'lib/month_range/month.rb', line 57

def to_f
  Float::INFINITY
end