Exception: Ubcbooker::Error::UnsupportedDate

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date = "unknown") ⇒ UnsupportedDate

Returns a new instance of UnsupportedDate.



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ubcbooker/error.rb', line 14

def initialize(date = "unknown")
  @date = date
  @message = "Error: Unsupported Date\n".red <<
    "Date must not be:\n" <<
    "  - in the past\n" <<
    "  - in a weekend\n" <<
    "  - beyond a week\n" <<
    "Please check if the time is in the format of MM/DD\n" <<
    "Ex. 03/05"
  super
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



13
14
15
# File 'lib/ubcbooker/error.rb', line 13

def date
  @date
end

#messageObject (readonly)

Returns the value of attribute message.



13
14
15
# File 'lib/ubcbooker/error.rb', line 13

def message
  @message
end