Exception: Yay::UnresolvedSubstitutionError

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

Overview

raised when a variable has been referenced but not given a value. for example cheese is @x without ever defining what @x is

Instance Attribute Summary collapse

Attributes inherited from Error

#position

Instance Method Summary collapse

Methods inherited from Error

#printable_position

Constructor Details

#initialize(variable) ⇒ UnresolvedSubstitutionError

Returns a new instance of UnresolvedSubstitutionError.



113
114
115
# File 'lib/yay/errors.rb', line 113

def initialize variable
  @variable = variable
end

Instance Attribute Details

#variableObject (readonly)

Returns the value of attribute variable.



111
112
113
# File 'lib/yay/errors.rb', line 111

def variable
  @variable
end

Instance Method Details

#printable_messageObject



117
118
119
# File 'lib/yay/errors.rb', line 117

def printable_message
  return "The variable #{variable} is being used but hasn't been set #{printable_position}"
end