Class: Gumbo::LiquidFile::AssetPackageTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/gumbo/liquid_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, file_name, tokens) ⇒ AssetPackageTag

Returns a new instance of AssetPackageTag.



16
17
18
19
# File 'lib/gumbo/liquid_file.rb', line 16

def initialize(tag_name, file_name, tokens)
   super
   @file_name = file_name
end

Instance Method Details

#render(context) ⇒ Object



21
22
23
24
25
26
# File 'lib/gumbo/liquid_file.rb', line 21

def render(context)
  parts = @file_name.split('.')
  ext = parts.pop.strip
  name = parts.join('.')
  context["asset_packages"][ext][name]
end