Updating documentation for LiquidTagBase (#15933)

In addition adding a Rubocop auto-update.
This commit is contained in:
Jeremy Friesen 2022-01-03 14:34:37 -05:00 committed by GitHub
parent bb17094e6b
commit 72b89aa57c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,3 +1,16 @@
# @abstract
#
# We created this class as a wrapper to `Liquid::Tag`. This follows
# Forem's aspirational architectural decision to create
# wrapping/insulating classes around our gem dependencies.
#
# This pattern is analogous to creating ApplicationRecord models that
# inherit from ActiveRecord::Base.
#
# @note When making a new Liquid tag, inherit from this class instead
# of `Liquid::Base`.
#
# @see https://github.com/Shopify/liquid
class LiquidTagBase < Liquid::Tag
# The method name to send the user to ask whether or not they
# have access to the given liquid tag.
@ -47,7 +60,7 @@ class LiquidTagBase < Liquid::Tag
private
def validate_contexts
return unless self.class.const_defined? "VALID_CONTEXTS"
return unless self.class.const_defined? :VALID_CONTEXTS
source = parse_context.partial_options[:source]
raise LiquidTags::Errors::InvalidParseContext, "No source found" unless source