Class: Sourcerer::SourceSkim::Config Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#categoriesObject (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

#descriptionsObject (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

#formsObject (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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


46
47
48
# File 'lib/sourcerer/source_skim/config.rb', line 46

def tree?
  @forms.include?(:tree)
end