Class: Jekyll::Strapi::StrapiDocumentDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Jekyll::Strapi::StrapiDocumentDrop
- Defined in:
- lib/jekyll/strapi/drops.rb
Overview
Strapi Document access in Liquid
Instance Attribute Summary collapse
-
#document ⇒ Object
Returns the value of attribute document.
Instance Method Summary collapse
- #[](attribute) ⇒ Object
-
#initialize(document) ⇒ StrapiDocumentDrop
constructor
A new instance of StrapiDocumentDrop.
Constructor Details
#initialize(document) ⇒ StrapiDocumentDrop
Returns a new instance of StrapiDocumentDrop.
7 8 9 |
# File 'lib/jekyll/strapi/drops.rb', line 7 def initialize(document) @document = document end |
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
5 6 7 |
# File 'lib/jekyll/strapi/drops.rb', line 5 def document @document end |
Instance Method Details
#[](attribute) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/jekyll/strapi/drops.rb', line 11 def [](attribute) value = @document[attribute] case value when OpenStruct StrapiDocumentDrop.new(value) when Array StrapiCollectionDrop.new(value) else value end end |