lib/webby/resources/resource.rb in webby-0.8.4 vs lib/webby/resources/resource.rb in webby-0.9.0
- old
+ new
@@ -70,17 +70,27 @@
# call-seq:
# resource[key] => value or nil
#
# Returns the value associated with the given meta-data key. Key is
- # usually a string.
+ # converted into a string.
#
def []( key )
- @mdata[key]
+ @mdata[key.to_s]
end
# call-seq:
+ # resource[key] = value
+ #
+ # Sets the given meta-data key to the value. Key is converted into a
+ # string.
+ #
+ def []=( key, value )
+ @mdata[key.to_s] = value
+ end
+
+ # call-seq:
# method_missing( symbol [, *args, &block] ) => result
#
# Invoked by Ruby when a message is sent to the resource that it cannot
# handle. The default behavior is to convert _symbol_ to a string and
# search for that string in the resource's meta-data. If found, the
@@ -109,10 +119,10 @@
return dirty if dirty
# check to see if the layout is dirty, and if it is then we
# are dirty, too
if @mdata.has_key? 'layout'
- lyt = ::Webby::Resources.layouts.find :filename => @mdata['layout']
+ lyt = ::Webby::Resources.find_layout(@mdata['layout'])
unless lyt.nil?
return true if lyt.dirty?
end
end