Class: MarshalParser::Formatters::AST::Renderers::Renderer
- Inherits:
-
Object
- Object
- MarshalParser::Formatters::AST::Renderers::Renderer
- Defined in:
- lib/marshal-parser/formatters/ast/renderers/renderer.rb
Instance Method Summary collapse
-
#initialize(indent_size:) ⇒ Renderer
constructor
A new instance of Renderer.
- #render(block) ⇒ Object
Constructor Details
#initialize(indent_size:) ⇒ Renderer
Returns a new instance of Renderer.
8 9 10 |
# File 'lib/marshal-parser/formatters/ast/renderers/renderer.rb', line 8 def initialize(indent_size:) @indent_size = indent_size end |
Instance Method Details
#render(block) ⇒ Object
12 13 14 15 16 |
# File 'lib/marshal-parser/formatters/ast/renderers/renderer.rb', line 12 def render(block) lines = apply_indentation(block, 0) strings = lines.map(&:string) strings.join("\n") end |