lib/roda/plugins/content_for.rb
def content_for(key, value=nil, &block)
          append = opts[:append_content_for]

          if block || value
            if block
              value = capture_erb(&block)
            end

            @_content_for ||= {}

            if append
              (@_content_for[key] ||= []) << value
            else
              @_content_for[key] = value
            end
          elsif @_content_for && (value = @_content_for[key])
            if append
              value = value.join
            end

            value
          end
        end
# If called with a block, store content enclosed by block
# under the given key.  If called without a block, retrieve
# stored content with the given key, or return nil if there
# is no content stored with that key.
If called with a block, store content enclosed by block
under the given key.  If called without a block, retrieve
stored content with the given key, or return nil if there
is no content stored with that key.
If called with a block store content enclosed by block under the given key . If called without a block retrieve stored content with the given key or return nil if there is no content stored with that key .
def content_for(key, value=nil, &block)
          append = opts[:append_content_for]
          if block || value
            if block
              value = capture_erb(&block)
            end
            @_content_for ||= {}
            if append
              (@_content_for[key] ||= []) << value
            else
              @_content_for[key] = value
            end
          elsif @_content_for && (value = @_content_for[key])
            if append
              value = value.join
            end
            value
          end
        end
def content_for ( key , value = nil , & block ) append = opts [ :append_content_for ] if block || value if block value = capture_erb ( & block ) end @_content_for ||= { } if append ( @_content_for [ key ] ||= [ ] ) << value else @_content_for [ key ] = value end elsif @_content_for && ( value = @_content_for [ key ] ) if append value = value . join end value end end
If called with a block, store content enclosed by block
under the given key.
If called with a block store content enclosed by block under the given key .
key
value
block