Class: Sourcerer::SourceSkim::Config Private
- Inherits:
-
Object
- Object
- Sourcerer::SourceSkim::Config
- Defined in:
- lib/sourcerer/source_skim/config.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.
Configuration profile for a single SourceSkim pass.
Controls which section shapes and element categories are emitted.
Callers pass a Config instance to Skimmer#process; it is not part of
the public-facing module API and should be constructed via the keyword
arguments on skim_file and friends.
Instance Attribute Summary collapse
- #categories ⇒ Object readonly private
- #descriptions ⇒ Object readonly private
- #forms ⇒ Object readonly private
Instance Method Summary collapse
- #descriptions? ⇒ Boolean private
- #flat? ⇒ Boolean private
- #include?(category) ⇒ Boolean private
-
#initialize(forms: [:tree], categories: nil, descriptions: false) ⇒ Config
constructor
private
A new instance of Config.
- #tree? ⇒ Boolean private
Constructor Details
#initialize(forms: [:tree], categories: nil, descriptions: false) ⇒ Config
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 Config.
36 37 38 39 40 |
# File 'lib/sourcerer/source_skim/config.rb', line 36 def initialize forms: [:tree], categories: nil, descriptions: false @forms = Array(forms).map(&:to_sym) @categories = categories ? Array(categories).map(&:to_sym) : DEFAULT_CATEGORIES.dup @descriptions = descriptions end |
Instance Attribute Details
#categories ⇒ Object (readonly)
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.
34 35 36 |
# File 'lib/sourcerer/source_skim/config.rb', line 34 def categories @categories end |
#descriptions ⇒ Object (readonly)
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.
34 35 36 |
# File 'lib/sourcerer/source_skim/config.rb', line 34 def descriptions @descriptions end |
#forms ⇒ Object (readonly)
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.
34 35 36 |
# File 'lib/sourcerer/source_skim/config.rb', line 34 def forms @forms end |
Instance Method Details
#descriptions? ⇒ Boolean
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.
54 55 56 |
# File 'lib/sourcerer/source_skim/config.rb', line 54 def descriptions? @descriptions end |
#flat? ⇒ Boolean
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.
50 51 52 |
# File 'lib/sourcerer/source_skim/config.rb', line 50 def flat? @forms.include?(:flat) end |
#include?(category) ⇒ Boolean
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.
42 43 44 |
# File 'lib/sourcerer/source_skim/config.rb', line 42 def include? category @categories.include?(category.to_sym) end |
#tree? ⇒ Boolean
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.
46 47 48 |
# File 'lib/sourcerer/source_skim/config.rb', line 46 def tree? @forms.include?(:tree) end |