Class: Seams::Generators::Splicer::Result
- Inherits:
-
Struct
- Object
- Struct
- Seams::Generators::Splicer::Result
- Defined in:
- lib/seams/generators/splicer.rb
Overview
Result struct returned by every splice operation. ‘ok?` is the only required predicate; `error` is populated only when ok? is false; `lines_added` is 0 when ok? is true but the splice was a no-op (idempotency hit).
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#lines_added ⇒ Object
Returns the value of attribute lines_added.
-
#ok? ⇒ Object
Returns the value of attribute ok?.
Instance Method Summary collapse
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error
55 56 57 |
# File 'lib/seams/generators/splicer.rb', line 55 def error @error end |
#lines_added ⇒ Object
Returns the value of attribute lines_added
55 56 57 |
# File 'lib/seams/generators/splicer.rb', line 55 def lines_added @lines_added end |
#ok? ⇒ Object
Returns the value of attribute ok?
55 56 57 |
# File 'lib/seams/generators/splicer.rb', line 55
def ok?
@ok?
end
|
Instance Method Details
#to_s ⇒ Object
56 57 58 |
# File 'lib/seams/generators/splicer.rb', line 56 def to_s ok? ? "Splicer::Result(ok, +#{lines_added})" : "Splicer::Result(error: #{error})" end |