Class: Woods::Chunking::MethodChunker Private
- Inherits:
-
Object
- Object
- Woods::Chunking::MethodChunker
- Includes:
- ChunkBuilder
- Defined in:
- lib/woods/chunking/semantic_chunker.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.
Generic method-aware chunker for class-like unit types.
Splits into:
-
‘:summary` — class/module declaration, includes, constants, attr_* DSL, class-level method calls, and any class-level code before the first public method.
-
‘:method_<name>` — one chunk per public instance method.
-
‘:private_methods` — all private/protected methods bundled together (they’re usually implementation helpers and rarely queried individually).
Used for services, jobs, mailers, concerns, policies, serializers, decorators, presenters, interactors, form objects, components, GraphQL resolvers, helpers, validators, and other class-like units.
Instance Method Summary collapse
- #chunk ⇒ Array<Chunk> private
-
#initialize(unit) ⇒ MethodChunker
constructor
private
A new instance of MethodChunker.
Constructor Details
#initialize(unit) ⇒ MethodChunker
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.
Returns a new instance of MethodChunker.
525 526 527 |
# File 'lib/woods/chunking/semantic_chunker.rb', line 525 def initialize(unit) @unit = unit end |
Instance Method Details
#chunk ⇒ Array<Chunk>
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.
530 531 532 533 |
# File 'lib/woods/chunking/semantic_chunker.rb', line 530 def chunk state = parse_lines(@unit.source_code.lines) build_chunks(state).reject(&:empty?) end |