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
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
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/unparser/cli/source.rb', line 53 def report case when original_ast && generated_ast report_with_ast_diff when !original_ast report_original when !generated.success? report_unparser when !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
43 44 45 |
# File 'lib/unparser/cli/source.rb', line 43 def success? generated.success? && original_ast && generated_ast && original_ast.eql?(generated_ast) end |