Class: Jekyll::Strapi::StrapiCollectionDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Jekyll::Strapi::StrapiCollectionDrop
- Defined in:
- lib/jekyll/strapi/drops.rb
Overview
Handles a single Strapi collection in Liquid
Instance Method Summary collapse
-
#initialize(collection) ⇒ StrapiCollectionDrop
constructor
A new instance of StrapiCollectionDrop.
- #to_liquid ⇒ Object
Constructor Details
#initialize(collection) ⇒ StrapiCollectionDrop
Returns a new instance of StrapiCollectionDrop.
27 28 29 |
# File 'lib/jekyll/strapi/drops.rb', line 27 def initialize(collection) @collection = collection end |
Instance Method Details
#to_liquid ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/jekyll/strapi/drops.rb', line 31 def to_liquid results = [] @collection.each do |result| results << StrapiDocumentDrop.new(result) end results end |