Exception: Yay::CircularReferenceError
- Defined in:
- lib/yay/errors.rb
Overview
raised when there’s a circular reference between rules. this happens when variables point back to themselves in some way. e.g. @x is @y and @y is @x
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(current, path) ⇒ CircularReferenceError
constructor
A new instance of CircularReferenceError.
- #printable_message ⇒ Object
Methods inherited from Error
Constructor Details
#initialize(current, path) ⇒ CircularReferenceError
Returns a new instance of CircularReferenceError.
98 99 100 101 |
# File 'lib/yay/errors.rb', line 98 def initialize current, path @current = current @path = path end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
95 96 97 |
# File 'lib/yay/errors.rb', line 95 def current @current end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
96 97 98 |
# File 'lib/yay/errors.rb', line 96 def path @path end |
Instance Method Details
#printable_message ⇒ Object
103 104 105 |
# File 'lib/yay/errors.rb', line 103 def return "There is a circular reference between variables: #{path.join(' => ')} => #{current}#{printable_position}" end |