Sha256: fc29bccf9166ca0cb824e8b7eb813914df61abf5c01f87beeca7523dfd91d66d
Contents?: true
Size: 469 Bytes
Versions: 30
Compression:
Stored size: 469 Bytes
Contents
module Liquid module CustomBlocks class WithJsonNestedContext < Block def initialize(tag_name, markup, tokens) super @context_file_variable, @context_name = markup.split(",").map(&:strip) end def render(context) context_file = context[@context_file_variable].to_s.strip context[@context_name] = JSON.parse( File.read(context_file, encoding: "utf-8") ) super end end end end
Version data entries
30 entries across 30 versions & 2 rubygems