Class: Rubyists::Namespacer::Rewriter
- Inherits:
-
Parser::TreeRewriter
- Object
- Parser::TreeRewriter
- Rubyists::Namespacer::Rewriter
- Defined in:
- lib/namespacer/rewriter.rb
Overview
Do the AST rewriting with the Rewriter class
Instance Attribute Summary collapse
-
#namespaces ⇒ Object
Returns the value of attribute namespaces.
Instance Method Summary collapse
-
#initialize(namespaces) ⇒ Rewriter
constructor
A new instance of Rewriter.
- #on_class(node) ⇒ Object
- #on_module(node) ⇒ Object
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
#namespaces ⇒ Object
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 |