Module: Rubyzen::Providers::ConstantsProvider

Overview

Provides access to constant references and assignments within a declaration.

Instance Method Summary collapse

Instance Method Details

#constantsRubyzen::Collections::ConstantsCollection

Returns collection of constant declarations.

Returns:



6
7
8
9
10
11
12
13
14
# File 'lib/rubyzen/providers/constants_provider.rb', line 6

def constants
  constant_nodes = node.each_descendant(:casgn, :const)

  Collections::ConstantsCollection.new(
    constant_nodes.map do |const_node|
      Declarations::ConstantDeclaration.new(const_node, self)
    end
  )
end