Class: TraversingContext
- Inherits:
-
Object
- Object
- TraversingContext
- Extended by:
- Forwardable
- Defined in:
- lib/ripper/extract_constants.rb
Instance Attribute Summary collapse
-
#module ⇒ Object
readonly
Returns the value of attribute module.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #full_class_name(class_name) ⇒ Object
-
#initialize(mod = [], options = {}) ⇒ TraversingContext
constructor
A new instance of TraversingContext.
- #module_name ⇒ Object
- #push_modules(*modules) ⇒ Object
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 = [], = {}) @module = mod @options = end |
Instance Attribute Details
#module ⇒ Object (readonly)
Returns the value of attribute module.
6 7 8 |
# File 'lib/ripper/extract_constants.rb', line 6 def module @module end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/ripper/extract_constants.rb', line 6 def @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_name ⇒ Object
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 |