Class: Jekyll::CollectionReader
- Inherits:
-
Object
- Object
- Jekyll::CollectionReader
- Defined in:
- lib/jekyll/readers/collection_reader.rb
Constant Summary collapse
- SPECIAL_COLLECTIONS =
%w(posts data).freeze
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Instance Method Summary collapse
-
#initialize(site) ⇒ CollectionReader
constructor
A new instance of CollectionReader.
-
#read ⇒ Object
Read in all collections specified in the configuration.
Constructor Details
#initialize(site) ⇒ CollectionReader
Returns a new instance of CollectionReader.
6 7 8 9 |
# File 'lib/jekyll/readers/collection_reader.rb', line 6 def initialize(site) @site = site @content = {} end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
5 6 7 |
# File 'lib/jekyll/readers/collection_reader.rb', line 5 def content @content end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
5 6 7 |
# File 'lib/jekyll/readers/collection_reader.rb', line 5 def site @site end |
Instance Method Details
#read ⇒ Object
Read in all collections specified in the configuration
Returns nothing.
14 15 16 17 18 |
# File 'lib/jekyll/readers/collection_reader.rb', line 14 def read site.collections.each do |_, collection| collection.read unless SPECIAL_COLLECTIONS.include?(collection.label) end end |