class Liquid::ParseContext
Attributes
Public Class Methods
Source
# File lib/liquid/parse_context.rb, line 6 def initialize(options = {}) @template_options = options ? options.dup : {} @locale = @template_options[:locale] ||= I18n.new @warnings = [] self.depth = 0 self.partial = false end
Public Instance Methods
Source
# File lib/liquid/parse_context.rb, line 14 def [](option_key) @options[option_key] end
Source
# File lib/liquid/parse_context.rb, line 18 def partial=(value) @partial = value @options = value ? partial_options : @template_options @error_mode = @options[:error_mode] || Template.error_mode value end
Source
# File lib/liquid/parse_context.rb, line 25 def partial_options @partial_options ||= begin dont_pass = @template_options[:include_options_blacklist] if dont_pass == true { locale: locale } elsif dont_pass.is_a?(Array) @template_options.reject { |k, v| dont_pass.include?(k) } else @template_options end end end