Class: Jekyll::Strapi::StrapiCollectionsDrop

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

Overview

Handles Strapi collections in Liquid, and creates the collection on demand

Instance Method Summary collapse

Constructor Details

#initialize(collections) ⇒ StrapiCollectionsDrop

Returns a new instance of StrapiCollectionsDrop.



42
43
44
# File 'lib/jekyll/strapi/drops.rb', line 42

def initialize(collections)
  @collections = collections
end

Instance Method Details

#[](collection_name) ⇒ Object



46
47
48
# File 'lib/jekyll/strapi/drops.rb', line 46

def [](collection_name)
  StrapiCollectionDrop.new(@collections[collection_name])
end