Class: Steep::Subtyping::Result::Failure
- Defined in:
- lib/steep/subtyping/result.rb
Defined Under Namespace
Classes: BlockMismatchError, MethodMissingError, ParameterMismatchError, PolyMethodSubtyping, UnknownPairError
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#trace ⇒ Object
readonly
Returns the value of attribute trace.
Instance Method Summary collapse
- #drop(n) ⇒ Object
-
#initialize(error:, trace:) ⇒ Failure
constructor
A new instance of Failure.
- #merge_trace(trace) ⇒ Object
- #success? ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(error:, trace:) ⇒ Failure
Returns a new instance of Failure.
102 103 104 105 |
# File 'lib/steep/subtyping/result.rb', line 102 def initialize(error:, trace:) @error = error @trace = trace.dup end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
99 100 101 |
# File 'lib/steep/subtyping/result.rb', line 99 def error @error end |
#trace ⇒ Object (readonly)
Returns the value of attribute trace.
100 101 102 |
# File 'lib/steep/subtyping/result.rb', line 100 def trace @trace end |
Instance Method Details
#drop(n) ⇒ Object
120 121 122 |
# File 'lib/steep/subtyping/result.rb', line 120 def drop(n) self.class.new(error: error, trace: trace.drop(n)) end |
#merge_trace(trace) ⇒ Object
111 112 113 114 115 116 117 118 |
# File 'lib/steep/subtyping/result.rb', line 111 def merge_trace(trace) if trace.empty? self else self.class.new(error: error, trace: trace + self.trace) end end |
#success? ⇒ Boolean
107 108 109 |
# File 'lib/steep/subtyping/result.rb', line 107 def success? false end |