Class: TraversingContext

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/ripper/extract_constants.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mod = [], options = {}) ⇒ TraversingContext

Returns a new instance of TraversingContext.



9
10
11
12
# File 'lib/ripper/extract_constants.rb', line 9

def initialize(mod = [], options = {})
  @module = mod
  @options = options
end

Instance Attribute Details

#moduleObject (readonly)

Returns the value of attribute module.



6
7
8
# File 'lib/ripper/extract_constants.rb', line 6

def module
  @module
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/ripper/extract_constants.rb', line 6

def options
  @options
end

Instance Method Details

#full_class_name(class_name) ⇒ Object



22
23
24
# File 'lib/ripper/extract_constants.rb', line 22

def full_class_name(class_name)
  module_name + '::' + class_name
end

#module_nameObject



18
19
20
# File 'lib/ripper/extract_constants.rb', line 18

def module_name
  @module.join('::')
end

#push_modules(*modules) ⇒ Object



14
15
16
# File 'lib/ripper/extract_constants.rb', line 14

def push_modules(*modules)
  @module = @module.concat(modules)
end