Class: Jekyll::AgentMarkdown::DocumentSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/agent_markdown/document_settings.rb

Constant Summary collapse

ALLOWED_SETTINGS =
%w[export index section optional include_document_header].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document, settings, source_kind:, collection_name: nil) ⇒ DocumentSettings

Returns a new instance of DocumentSettings.



13
14
15
16
17
18
19
20
# File 'lib/jekyll/agent_markdown/document_settings.rb', line 13

def initialize(document, settings, source_kind:, collection_name: nil)
  @document = document
  @settings = settings
  @source_kind = SourceSettings.kind(source_kind, document_path)
  @collection_name = SourceSettings.collection_name(collection_name, @source_kind, document_path)

  apply(normalized_document_settings)
end

Instance Attribute Details

#sectionObject (readonly)

Returns the value of attribute section.



11
12
13
# File 'lib/jekyll/agent_markdown/document_settings.rb', line 11

def section
  @section
end

Instance Method Details

#export?Boolean

Returns:

  • (Boolean)


22
# File 'lib/jekyll/agent_markdown/document_settings.rb', line 22

def export? = @export

#include_document_header?Boolean

Returns:

  • (Boolean)


28
# File 'lib/jekyll/agent_markdown/document_settings.rb', line 28

def include_document_header? = @include_document_header

#index?Boolean

Returns:

  • (Boolean)


24
# File 'lib/jekyll/agent_markdown/document_settings.rb', line 24

def index? = @index

#optional?Boolean

Returns:

  • (Boolean)


26
# File 'lib/jekyll/agent_markdown/document_settings.rb', line 26

def optional? = @optional