Exception: CircularDependencyError
- Inherits:
-
StandardError
- Object
- StandardError
- CircularDependencyError
- Defined in:
- lib/dep_check/CircularDependencyError.rb
Overview
循环依赖检测时用到的一个异常类型,便于抛异常时传递参数
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#message ⇒ Object
Returns the value of attribute message.
-
#path ⇒ Object
Returns the value of attribute path.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(from, to, path, message = 'Circular dependency detected!') ⇒ CircularDependencyError
constructor
A new instance of CircularDependencyError.
- #to_s ⇒ Object
Constructor Details
#initialize(from, to, path, message = 'Circular dependency detected!') ⇒ CircularDependencyError
Returns a new instance of CircularDependencyError.
12 13 14 15 16 17 |
# File 'lib/dep_check/CircularDependencyError.rb', line 12 def initialize(from, to , path , = 'Circular dependency detected!') @from = from @to = to @path = path @message = end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
3 4 5 |
# File 'lib/dep_check/CircularDependencyError.rb', line 3 def from @from end |
#message ⇒ Object
Returns the value of attribute message.
6 7 8 |
# File 'lib/dep_check/CircularDependencyError.rb', line 6 def @message end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/dep_check/CircularDependencyError.rb', line 5 def path @path end |
#to ⇒ Object
Returns the value of attribute to.
4 5 6 |
# File 'lib/dep_check/CircularDependencyError.rb', line 4 def to @to end |
Instance Method Details
#to_s ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/dep_check/CircularDependencyError.rb', line 19 def to_s = String.new @path.each { |name| << name + '--->' } << @to "#{super} \n #{@message} \n #{@from} <---> #{@to} . \n Full Path: #{} " end |