Class: Rubyists::Namespacer::Rewriter

Inherits:
Parser::TreeRewriter
  • Object
show all
Defined in:
lib/namespacer/rewriter.rb

Overview

Do the AST rewriting with the Rewriter class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespaces) ⇒ Rewriter

Returns a new instance of Rewriter.



9
10
11
12
# File 'lib/namespacer/rewriter.rb', line 9

def initialize(namespaces)
  super()
  @namespaces = namespaces
end

Instance Attribute Details

#namespacesObject

Returns the value of attribute namespaces.



7
8
9
# File 'lib/namespacer/rewriter.rb', line 7

def namespaces
  @namespaces
end

Instance Method Details

#on_class(node) ⇒ Object



18
19
20
# File 'lib/namespacer/rewriter.rb', line 18

def on_class(node)
  _on_module(node)
end

#on_module(node) ⇒ Object



14
15
16
# File 'lib/namespacer/rewriter.rb', line 14

def on_module(node)
  _on_module(node)
end