Exception: Ubcbooker::Error::NoAvailableRoom

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time_range) ⇒ NoAvailableRoom

Returns a new instance of NoAvailableRoom.



62
63
64
65
66
67
68
# File 'lib/ubcbooker/error.rb', line 62

def initialize(time_range)
  @time_range = time_range
  @message = "Error: No Available Room\n".red <<
    "There are no room available for #{time_range} range\n" <<
    "Please try again with a different time range"
  super
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



61
62
63
# File 'lib/ubcbooker/error.rb', line 61

def message
  @message
end

#time_rangeObject (readonly)

Returns the value of attribute time_range.



61
62
63
# File 'lib/ubcbooker/error.rb', line 61

def time_range
  @time_range
end