Exception: Yay::AlreadyAssignedError

Inherits:
Error
  • Object
show all
Defined in:
lib/yay/errors.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#position

Instance Method Summary collapse

Methods inherited from Error

#printable_position

Constructor Details

#initialize(variable) ⇒ AlreadyAssignedError

Returns a new instance of AlreadyAssignedError.



24
25
26
# File 'lib/yay/errors.rb', line 24

def initialize variable
  @variable = variable
end

Instance Attribute Details

#variableObject (readonly)

Returns the value of attribute variable.



22
23
24
# File 'lib/yay/errors.rb', line 22

def variable
  @variable
end

Instance Method Details

#printable_messageObject



28
29
30
# File 'lib/yay/errors.rb', line 28

def printable_message
  return "The variable #{variable} has already been assigned a value#{printable_position}"
end