Class: Victor::CLI::CodeGenerator
- Inherits:
-
Object
- Object
- Victor::CLI::CodeGenerator
- Defined in:
- lib/victor/cli/code_generator.rb
Instance Attribute Summary collapse
-
#svg_tree ⇒ Object
readonly
Returns the value of attribute svg_tree.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(svg_tree, template: nil) ⇒ CodeGenerator
constructor
A new instance of CodeGenerator.
Constructor Details
#initialize(svg_tree, template: nil) ⇒ CodeGenerator
Returns a new instance of CodeGenerator.
8 9 10 11 |
# File 'lib/victor/cli/code_generator.rb', line 8 def initialize(svg_tree, template: nil) @svg_tree = svg_tree @template = template || :cli end |
Instance Attribute Details
#svg_tree ⇒ Object (readonly)
Returns the value of attribute svg_tree.
6 7 8 |
# File 'lib/victor/cli/code_generator.rb', line 6 def svg_tree @svg_tree end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
6 7 8 |
# File 'lib/victor/cli/code_generator.rb', line 6 def template @template end |
Instance Method Details
#generate ⇒ Object
13 14 15 |
# File 'lib/victor/cli/code_generator.rb', line 13 def generate Rufo::Formatter.format(code_for_node(svg_tree)) end |