Exception: Ubcbooker::Error::UnsupportedDate
- Inherits:
-
StandardError
- Object
- StandardError
- Ubcbooker::Error::UnsupportedDate
- Defined in:
- lib/ubcbooker/error.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(date = "unknown") ⇒ UnsupportedDate
constructor
A new instance of UnsupportedDate.
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 = "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
#date ⇒ Object (readonly)
Returns the value of attribute date.
13 14 15 |
# File 'lib/ubcbooker/error.rb', line 13 def date @date end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
13 14 15 |
# File 'lib/ubcbooker/error.rb', line 13 def end |