Class: Unparser::CLI::Source::Generated
- Inherits:
-
Object
- Object
- Unparser::CLI::Source::Generated
- Defined in:
- lib/unparser/cli/source.rb
Overview
Source state generated after first unparse
Class Method Summary collapse
-
.build(ast) ⇒ Object
private
Build generated source.
Instance Method Summary collapse
-
#success? ⇒ Boolean
private
Test if source was generated successfully.
Class Method Details
.build(ast) ⇒ Object
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.
Build generated source
31 32 33 34 35 36 |
# File 'lib/unparser/cli/source.rb', line 31 def self.build(ast) source = Unparser.unparse(ast) new(source, ast, nil) rescue StandardError => exception new(nil, ast, exception) end |
Instance Method Details
#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 was generated successfully
21 22 23 |
# File 'lib/unparser/cli/source.rb', line 21 def success? !error end |