Class: Mutant::Scope Private
- Inherits:
-
Object
- Object
- Mutant::Scope
- Includes:
- Unparser::Adamantium
- Defined in:
- lib/mutant/scope.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class or Module bound to an exact expression
Constant Summary collapse
- NAMESPACE_DELIMITER =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'::'
Instance Method Summary collapse
-
#match_expressions ⇒ Enumerable<Expression>
private
Match expressions for scope.
-
#nesting ⇒ Enumerable<Class,Module>
private
Nesting of scope.
-
#unqualified_name ⇒ String
private
Unqualified name of scope.
Instance Method Details
#match_expressions ⇒ Enumerable<Expression>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Match expressions for scope
31 32 33 34 35 36 37 |
# File 'lib/mutant/scope.rb', line 31 def match_expressions name_nesting.each_index.reverse_each.map do |index| Expression::Namespace::Recursive.new( scope_name: name_nesting.take(index.succ).join(NAMESPACE_DELIMITER) ) end end |
#nesting ⇒ Enumerable<Class,Module>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Nesting of scope
13 14 15 16 17 18 |
# File 'lib/mutant/scope.rb', line 13 def nesting const = Object name_nesting.map do |name| const = const.const_get(name) end end |
#unqualified_name ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Unqualified name of scope
24 25 26 |
# File 'lib/mutant/scope.rb', line 24 def unqualified_name name_nesting.last end |