Module: Locomotive::Plugin::Liquid::TagSubclassMethods
- Defined in:
- lib/locomotive/plugin/liquid/tag_subclass_methods.rb
Overview
The methods shared by all tag subclasses.
Instance Method Summary collapse
-
#prefix ⇒ Object
The prefix for this tag.
-
#render(context) ⇒ Object
Check to see if this tag is enabled in the liquid context and render accordingly.
Instance Method Details
#prefix ⇒ Object
The prefix for this tag.
36 37 38 |
# File 'lib/locomotive/plugin/liquid/tag_subclass_methods.rb', line 36 def prefix self.class.prefix end |
#render(context) ⇒ Object
Check to see if this tag is enabled in the liquid context and render accordingly.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/locomotive/plugin/liquid/tag_subclass_methods.rb', line 16 def render(context) = context.registers[:enabled_plugin_tags] enabled = && .include?(self.class) output = nil ContextHelpers.add_plugin_object_to_context(self.prefix, context) do output = if enabled super elsif self.respond_to?(:render_disabled) self.render_disabled(context) else '' end end output end |