Class: CannedTuna::ContentProxy
- Inherits:
-
Object
- Object
- CannedTuna::ContentProxy
- Defined in:
- lib/canned_tuna/content_proxy.rb
Instance Method Summary collapse
-
#initialize ⇒ ContentProxy
constructor
A new instance of ContentProxy.
- #outlet(name = :default, &block) ⇒ Object
- #outlet_for(name, &default_content) ⇒ Object
Constructor Details
#initialize ⇒ ContentProxy
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 |