Module: Solid::LiquidExtensions::TagHighjacker

Included in:
AssignTag, ForTag, IfTag
Defined in:
lib/solid/liquid_extensions.rb

Instance Method Summary collapse

Instance Method Details

#load!Object



41
42
43
44
45
# File 'lib/solid/liquid_extensions.rb', line 41

def load!
  original_tag = Liquid::Template.tags[tag_name.to_s]
  original_tags[tag_name] = original_tag unless original_tags.has_key?(tag_name) # avoid loosing reference to original class
  Liquid::Template.register_tag(tag_name, self)
end

#tag_name(name = nil) ⇒ Object



51
52
53
54
# File 'lib/solid/liquid_extensions.rb', line 51

def tag_name(name=nil)
  @tag_name = name unless name.nil?
  @tag_name
end

#unload!Object



47
48
49
# File 'lib/solid/liquid_extensions.rb', line 47

def unload!
  Liquid::Template.register_tag(tag_name, original_tags[tag_name])
end