Class: Mudguard::Domain::ConstVisitor

Inherits:
Object
  • Object
show all
Defined in:
lib/mudguard/domain/const_visitor.rb

Overview

Transforms AST-Nodes into Strings denoting consts

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConstVisitor

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

#constsObject (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