Exception: Yay::AlreadyAssignedError
- Defined in:
- lib/yay/errors.rb
Overview
this error is raised when a variable has already been assigned a value for example @x is red and @x is blue
Instance Attribute Summary collapse
-
#variable ⇒ Object
readonly
Returns the value of attribute variable.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(variable) ⇒ AlreadyAssignedError
constructor
A new instance of AlreadyAssignedError.
- #printable_message ⇒ Object
Methods inherited from Error
Constructor Details
#initialize(variable) ⇒ AlreadyAssignedError
Returns a new instance of AlreadyAssignedError.
66 67 68 |
# File 'lib/yay/errors.rb', line 66 def initialize variable @variable = variable end |
Instance Attribute Details
#variable ⇒ Object (readonly)
Returns the value of attribute variable.
64 65 66 |
# File 'lib/yay/errors.rb', line 64 def variable @variable end |
Instance Method Details
#printable_message ⇒ Object
70 71 72 |
# File 'lib/yay/errors.rb', line 70 def return "The variable #{variable} has already been assigned a value#{printable_position}" end |