Class: RubyIndexer::VisibilityScope
- Inherits:
-
Object
- Object
- RubyIndexer::VisibilityScope
- Defined in:
- lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb
Overview
Represents the visibility scope in a Ruby namespace. This keeps track of whether methods are in a public, private or protected section, and whether they are module functions.
Instance Attribute Summary collapse
-
#module_func ⇒ Object
readonly
: bool.
-
#visibility ⇒ Object
readonly
: Symbol.
Class Method Summary collapse
-
.module_function_scope ⇒ Object
: -> instance.
-
.public_scope ⇒ Object
: -> instance.
Instance Method Summary collapse
-
#initialize(visibility: :public, module_func: false) ⇒ VisibilityScope
constructor
: (?visibility: Symbol, ?module_func: bool) -> void.
Constructor Details
#initialize(visibility: :public, module_func: false) ⇒ VisibilityScope
: (?visibility: Symbol, ?module_func: bool) -> void
27 28 29 30 |
# File 'lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb', line 27 def initialize(visibility: :public, module_func: false) @visibility = visibility @module_func = module_func end |
Instance Attribute Details
#module_func ⇒ Object (readonly)
: bool
24 25 26 |
# File 'lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb', line 24 def module_func @module_func end |
#visibility ⇒ Object (readonly)
: Symbol
21 22 23 |
# File 'lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb', line 21 def visibility @visibility end |
Class Method Details
.module_function_scope ⇒ Object
: -> instance
10 11 12 |
# File 'lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb', line 10 def module_function_scope new(module_func: true, visibility: :private) end |
.public_scope ⇒ Object
: -> instance
15 16 17 |
# File 'lib/ruby_indexer/lib/ruby_indexer/visibility_scope.rb', line 15 def public_scope new end |