Class: ATP::Formatter

Inherits:
Processor show all
Defined in:
lib/atp/formatter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Processor

#handler_missing, #n, #n0, #n1, #process, #run

Class Method Details

.format(node, options = {}) ⇒ Object



7
8
9
# File 'lib/atp/formatter.rb', line 7

def self.format(node, options = {})
  new.format(node, options)
end

.run(*args) ⇒ Object



16
17
18
# File 'lib/atp/formatter.rb', line 16

def self.run(*args)
  run_and_format(*args)
end

.run_and_format(node, options = {}) ⇒ Object



11
12
13
14
# File 'lib/atp/formatter.rb', line 11

def self.run_and_format(node, options = {})
  ast = Runner.new.run(node, options)
  format(ast, options)
end

Instance Method Details

#format(node, options = {}) ⇒ Object



3
4
5
# File 'lib/atp/formatter.rb', line 3

def format(node, options = {})
  process(node)
end