Exception: Ubcbooker::Error::UnsupportedTime

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time = "unknown") ⇒ UnsupportedTime

Returns a new instance of UnsupportedTime.



29
30
31
32
33
34
35
# File 'lib/ubcbooker/error.rb', line 29

def initialize(time = "unknown")
  @time = time
  @message = "Error: Unsupported Time\n".red <<
    "Please check if the time is in the format of HH:MM-HH:MM\n" <<
    "Ex. 11:00-13:00"
  super
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



28
29
30
# File 'lib/ubcbooker/error.rb', line 28

def message
  @message
end

#timeObject (readonly)

Returns the value of attribute time.



28
29
30
# File 'lib/ubcbooker/error.rb', line 28

def time
  @time
end