Sha256: 42a6d6b4d460e6abdcdd449e53e0c1bb10898e643d2b31ac8ab448e0bd953682
Contents?: true
Size: 654 Bytes
Versions: 10
Compression:
Stored size: 654 Bytes
Contents
module Nanoc # Nanoc::PageRepProxy is a proxy object for a page representation # (Nanoc::PageRep). class PageRepProxy < Proxy # Requests the page 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 == :content @obj.content elsif real_key == :path @obj.web_path elsif real_key == :page @obj.page.to_proxy else super(key) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems