Sha256: d9544785a8e23172596408d2c77ba6d7765ae2659803c3f9545b60b42eb9a765

Contents?: true

Size: 876 Bytes

Versions: 4

Compression:

Stored size: 876 Bytes

Contents

module Reek
  module AST
    module SexpExtensions
      # Base module for utility methods for nodes representing variables.
      module VariableBase
        def name
          children.first
        end
      end

      # Utility methods for :cvar nodes.
      module CvarNode
        include VariableBase
      end

      # Utility methods for :ivar nodes.
      module IvarNode
        include VariableBase
      end

      # Utility methods for :ivasgn nodes.
      module IvasgnNode
        include VariableBase
      end

      # Utility methods for :lvar nodes.
      module LvarNode
        include VariableBase

        alias_method :var_name, :name
      end

      # Utility methods for :gvar nodes.
      module GvarNode
        include VariableBase
      end

      LvasgnNode = LvarNode
      CvasgnNode = CvarNode
      CvdeclNode = CvarNode
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reek-3.10.1 lib/reek/ast/sexp_extensions/variables.rb
reek-3.10.0 lib/reek/ast/sexp_extensions/variables.rb
reek-3.9.1 lib/reek/ast/sexp_extensions/variables.rb
reek-3.9.0 lib/reek/ast/sexp_extensions/variables.rb