Class: Holistic::Ruby::Parser::TableOfContents
- Inherits:
-
Object
- Object
- Holistic::Ruby::Parser::TableOfContents
- Defined in:
- lib/holistic/ruby/parser/table_of_contents.rb
Overview
TODO: move to an attibute of the scope
Instance Attribute Summary collapse
-
#records ⇒ Object
readonly
Returns the value of attribute records.
Instance Method Summary collapse
-
#initialize ⇒ TableOfContents
constructor
A new instance of TableOfContents.
- #register(scope:, name:, clue:) ⇒ Object
Constructor Details
#initialize ⇒ TableOfContents
Returns a new instance of TableOfContents.
8 9 10 |
# File 'lib/holistic/ruby/parser/table_of_contents.rb', line 8 def initialize @records = Hash.new { |hash, key| hash[key] = {} } end |
Instance Attribute Details
#records ⇒ Object (readonly)
Returns the value of attribute records.
6 7 8 |
# File 'lib/holistic/ruby/parser/table_of_contents.rb', line 6 def records @records end |
Instance Method Details
#register(scope:, name:, clue:) ⇒ Object
12 13 14 15 |
# File 'lib/holistic/ruby/parser/table_of_contents.rb', line 12 def register(scope:, name:, clue:) @records[scope.fully_qualified_name][name] ||= [] @records[scope.fully_qualified_name][name] << clue end |