Exception: LunarBlessing::OutOfRange

Inherits:
StandardError
  • Object
show all
Defined in:
lib/lunar_blessing.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(year) ⇒ OutOfRange

Returns a new instance of OutOfRange.



98
99
100
# File 'lib/lunar_blessing.rb', line 98

def initialize(year)
  @year = year
end

Instance Attribute Details

#yearObject (readonly)

Returns the value of attribute year.



97
98
99
# File 'lib/lunar_blessing.rb', line 97

def year
  @year
end

Instance Method Details

#messageObject



102
103
104
# File 'lib/lunar_blessing.rb', line 102

def message
  "The #{year} year you provided is out of range. This gem only support 1900 - 2099."
end