Class: Steep::Subtyping::Result::Expand
- Defined in:
- lib/steep/subtyping/result.rb
Instance Attribute Summary collapse
-
#child ⇒ Object
readonly
Returns the value of attribute child.
Attributes inherited from Base
Instance Method Summary collapse
- #failure_path(path = []) ⇒ Object
-
#initialize(relation, &block) ⇒ Expand
constructor
A new instance of Expand.
- #success? ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(relation, &block) ⇒ Expand
Returns a new instance of Expand.
55 56 57 58 59 60 |
# File 'lib/steep/subtyping/result.rb', line 55 def initialize(relation, &block) super relation @child = yield relation raise if @child == true end |
Instance Attribute Details
#child ⇒ Object (readonly)
Returns the value of attribute child.
53 54 55 |
# File 'lib/steep/subtyping/result.rb', line 53 def child @child end |
Instance Method Details
#failure_path(path = []) ⇒ Object
66 67 68 69 70 71 |
# File 'lib/steep/subtyping/result.rb', line 66 def failure_path(path = []) if child.failure? path.unshift(self) child.failure_path(path) end end |
#success? ⇒ Boolean
62 63 64 |
# File 'lib/steep/subtyping/result.rb', line 62 def success? child.success? end |