Sha256: c4eef09d3ee5a6e22b6c5e9084445b42b44414d4be7ae9f8bd18395f75a71c2a
Contents?: true
Size: 757 Bytes
Versions: 34
Compression:
Stored size: 757 Bytes
Contents
module Locomotive module Steam module Liquid module Drops class ContentTypes < ::Liquid::Drop def before_method(meth) if content_type = fetch_content_type(meth.to_s) ContentEntryCollection.new(content_type) else nil end end private def repository @context.registers[:services].repositories.content_type end def fetch_content_type(slug) @content_type_map ||= {} if !@content_type_map.include?(slug) @content_type_map[slug] = repository.by_slug(slug) end @content_type_map[slug] end end end end end end
Version data entries
34 entries across 34 versions & 1 rubygems