Class: MarshalParser::Formatters::AST::SExpressionCompact

Inherits:
Object
  • Object
show all
Defined in:
lib/marshal-parser/formatters/ast/sexpression_compact.rb

Instance Method Summary collapse

Constructor Details

#initialize(node, source_string, renderer) ⇒ SExpressionCompact

Returns a new instance of SExpressionCompact.



7
8
9
10
11
# File 'lib/marshal-parser/formatters/ast/sexpression_compact.rb', line 7

def initialize(node, source_string, renderer)
  @node = node
  @source_string = source_string
  @renderer = renderer
end

Instance Method Details

#stringObject



13
14
15
16
17
# File 'lib/marshal-parser/formatters/ast/sexpression_compact.rb', line 13

def string
  entries = node_to_entries(@node)
  block = Renderers::EntriesBlock.new(entries)
  @renderer.render(block)
end