Class: Mudguard::Domain::ConstVisitor
- Inherits:
-
Object
- Object
- Mudguard::Domain::ConstVisitor
- Defined in:
- lib/mudguard/domain/const_visitor.rb
Overview
Transforms AST-Nodes into Strings denoting consts
Instance Attribute Summary collapse
-
#consts ⇒ Object
readonly
Returns the value of attribute consts.
Instance Method Summary collapse
-
#initialize ⇒ ConstVisitor
constructor
A new instance of ConstVisitor.
- #visit_const_declaration(_location, const_name, module_name) ⇒ Object
-
#visit_dependency(_, __, ___) ⇒ Object
rubocop:disable Naming/MethodParameterName.
Constructor Details
#initialize ⇒ ConstVisitor
Returns a new instance of ConstVisitor.
7 8 9 |
# File 'lib/mudguard/domain/const_visitor.rb', line 7 def initialize @consts = [] end |
Instance Attribute Details
#consts ⇒ Object (readonly)
Returns the value of attribute consts.
11 12 13 |
# File 'lib/mudguard/domain/const_visitor.rb', line 11 def consts @consts end |
Instance Method Details
#visit_const_declaration(_location, const_name, module_name) ⇒ Object
15 16 17 |
# File 'lib/mudguard/domain/const_visitor.rb', line 15 def visit_const_declaration(_location, const_name, module_name) @consts << "#{module_name}#{const_name}" end |
#visit_dependency(_, __, ___) ⇒ Object
rubocop:disable Naming/MethodParameterName
13 |
# File 'lib/mudguard/domain/const_visitor.rb', line 13 def visit_dependency(_, __, ___); end |