Class: MarshalParser::Formatters::AST::OnlyTokens

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

Instance Method Summary collapse

Constructor Details

#initialize(node, source_string, renderer) ⇒ OnlyTokens

Returns a new instance of OnlyTokens.



7
8
9
10
11
# File 'lib/marshal-parser/formatters/ast/only_tokens.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/only_tokens.rb', line 13

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