Class: Landable::Liquid::AssetAttributeTag

Inherits:
AssetTag
  • Object
show all
Defined in:
lib/landable/liquid/asset_tags.rb

Instance Attribute Summary

Attributes inherited from AssetTag

#asset_name, #tag_name

Instance Method Summary collapse

Methods inherited from AssetTag

#initialize

Constructor Details

This class inherits a constructor from Landable::Liquid::AssetTag

Instance Method Details

#render(context) ⇒ Object



62
63
64
65
66
67
68
69
70
71
# File 'lib/landable/liquid/asset_tags.rb', line 62

def render(context)
  asset = lookup_asset context, asset_name
  attribute = tag_name.sub(/^asset_/, '')

  if attribute == 'url'
    asset.public_url
  else
    asset.send attribute
  end
end