Exception: Ubcbooker::Error::ProfaneName

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = "unknown") ⇒ ProfaneName

Returns a new instance of ProfaneName.



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

def initialize(name = "unknown")
  @name = name
  @message = "Error: Name includes profanity\n".red <<
    "Remember that other students might see the booking name\n" <<
    "Please try again with a different name"
  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

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end