Class: Jekyll::Strapi::StrapiCollectionDrop

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/jekyll/strapi/drops.rb

Overview

Handles a single Strapi collection in Liquid

Instance Method Summary collapse

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_liquidObject



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