Class: SyntaxTree::CLI::Format
Overview
An action of the CLI that formats the input source and prints it out.
Instance Attribute Summary collapse
-
#print_width ⇒ Object
readonly
Returns the value of attribute print_width.
Instance Method Summary collapse
-
#initialize(print_width:) ⇒ Format
constructor
A new instance of Format.
- #run(item) ⇒ Object
Methods inherited from Action
Constructor Details
#initialize(print_width:) ⇒ Format
Returns a new instance of Format.
169 170 171 |
# File 'lib/syntax_tree/cli.rb', line 169 def initialize(print_width:) @print_width = print_width end |
Instance Attribute Details
#print_width ⇒ Object (readonly)
Returns the value of attribute print_width.
167 168 169 |
# File 'lib/syntax_tree/cli.rb', line 167 def print_width @print_width end |
Instance Method Details
#run(item) ⇒ Object
173 174 175 |
# File 'lib/syntax_tree/cli.rb', line 173 def run(item) puts item.handler.format(item.source, print_width) end |