Exception: AocCli::Errors::YearInv

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(year) ⇒ YearInv

Returns a new instance of YearInv.



45
46
47
# File 'lib/aoc_cli/errors.rb', line 45

def initialize(year)
  @year = year
end

Instance Attribute Details

#yearObject (readonly)

Returns the value of attribute year.



44
45
46
# File 'lib/aoc_cli/errors.rb', line 44

def year
  @year
end

Instance Method Details

#messageObject



48
49
50
51
52
53
# File 'lib/aoc_cli/errors.rb', line 48

def message
  "  \#{ERROR}: Invalid year: \#{year.to_s.red}\n  Advent of Code currently spans 2015 - 2020.\n  error\nend\n"