Sha256: b6795586304839239399b019c6a0ceccd00a25d81050301ff03a5df323c30431
Contents?: true
Size: 608 Bytes
Versions: 10
Compression:
Stored size: 608 Bytes
Contents
module Nanoc # Nanoc::AssetRepProxy is a proxy object for an asset representation # (Nanoc::AssetRep). class AssetRepProxy < Proxy # Requests the asset representation attribute with the given name. +key+ # can be a string or a symbol, and it can contain a trailing question mark # (which will be stripped). def [](key) real_key = key.to_s.sub(/\?$/, '').to_sym if real_key == :name @obj.name elsif real_key == :path @obj.web_path elsif real_key == :asset @obj.asset.to_proxy else super(key) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems