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? ⇒ true, false
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
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/unparser/cli/source.rb', line 56 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? ⇒ true, false
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
46 47 48 |
# File 'lib/unparser/cli/source.rb', line 46 def success? generated.success? && original_ast && generated_ast && original_ast == generated_ast end |