Class: Unparser::CLI::Source
- Inherits:
-
Object
- Object
- Unparser::CLI::Source
- Includes:
- AbstractType, Adamantium::Flat, NodeHelpers
- Defined in:
- lib/unparser/cli/source.rb
Overview
Source representation for CLI sources
ignore :reek:TooManyMethods
Defined Under Namespace
Classes: File, Generated, Node, String
Instance Method Summary collapse
-
#report ⇒ String
private
Return error report.
-
#success? ⇒ Boolean
private
Test if source could be unparsed successfully.
Methods included from NodeHelpers
Instance Method Details
#report ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return error report
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/unparser/cli/source.rb', line 55 def report if original_ast && generated_ast report_with_ast_diff elsif !original_ast report_original elsif !generated.success? report_unparser elsif !generated_ast report_generated else raise end end |
#success? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Test if source could be unparsed successfully
45 46 47 |
# File 'lib/unparser/cli/source.rb', line 45 def success? generated.success? && original_ast && generated_ast && original_ast.eql?(generated_ast) end |