Module: ImproveYourCode::AST::SexpExtensions::CasgnNode

Includes:
ConstantDefiningNodeBase
Defined in:
lib/improve_your_code/ast/sexp_extensions/module.rb

Instance Method Summary collapse

Methods included from ConstantDefiningNodeBase

#full_name, #simple_name

Instance Method Details

#defines_module?Boolean

Returns:

  • (Boolean)


35
36
37
38
# File 'lib/improve_your_code/ast/sexp_extensions/module.rb', line 35

def defines_module?
  call = constant_definition
  call&.module_creation_call?
end

#nameObject



40
41
42
# File 'lib/improve_your_code/ast/sexp_extensions/module.rb', line 40

def name
  children[1].to_s
end

#valueObject



44
45
46
# File 'lib/improve_your_code/ast/sexp_extensions/module.rb', line 44

def value
  children[2]
end