Class: Jekyll::CollectionPages::PathTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/collection_pages/path_template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_template:, tag_field:, collection_name:, require_num: true) ⇒ PathTemplate

Returns a new instance of PathTemplate.



10
11
12
13
14
15
# File 'lib/jekyll/collection_pages/path_template.rb', line 10

def initialize(raw_template:, tag_field:, collection_name:, require_num: true)
  @tag_field = tag_field
  @collection_name = collection_name
  @require_num = require_num
  @template = build_effective_template(raw_template)
end

Instance Attribute Details

#collection_nameObject (readonly)

Returns the value of attribute collection_name.



8
9
10
# File 'lib/jekyll/collection_pages/path_template.rb', line 8

def collection_name
  @collection_name
end

#tag_fieldObject (readonly)

Returns the value of attribute tag_field.



8
9
10
# File 'lib/jekyll/collection_pages/path_template.rb', line 8

def tag_field
  @tag_field
end

Instance Method Details

#templateObject



17
18
19
# File 'lib/jekyll/collection_pages/path_template.rb', line 17

def template
  "/#{@template}"
end