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.



51
52
53
54
55
56
57
# File 'lib/ubcbooker/error.rb', line 51

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.



50
51
52
# File 'lib/ubcbooker/error.rb', line 50

def message
  @message
end

#time_rangeObject (readonly)

Returns the value of attribute time_range.



50
51
52
# File 'lib/ubcbooker/error.rb', line 50

def time_range
  @time_range
end