Class: CannedTuna::ContentProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/canned_tuna/content_proxy.rb

Instance Method Summary collapse

Constructor Details

#initializeContentProxy

Returns a new instance of ContentProxy.



3
4
5
# File 'lib/canned_tuna/content_proxy.rb', line 3

def initialize
  @outlets = {}
end

Instance Method Details

#outlet(name = :default, &block) ⇒ Object



11
12
13
# File 'lib/canned_tuna/content_proxy.rb', line 11

def outlet name = :default, &block
  @outlets[name] = block
end

#outlet_for(name, &default_content) ⇒ Object



7
8
9
# File 'lib/canned_tuna/content_proxy.rb', line 7

def outlet_for name, &default_content
  @outlets[name] || default_content || proc {}
end