lib/webby/resources/resource.rb in webby-0.8.2 vs lib/webby/resources/resource.rb in webby-0.8.3
- old
+ new
@@ -1,7 +1,5 @@
-# $Id: resource.rb 198 2008-03-10 15:25:55Z tim_pease $
-
unless defined? Webby::Resources::Resource
module Webby::Resources
# A Webby::Resource is any file that can be found in the content directory
@@ -66,9 +64,19 @@
# _other_ is not a Resource instance.
#
def <=>( other )
return unless other.kind_of? ::Webby::Resources::Resource
@path <=> other.path
+ end
+
+ # call-seq:
+ # resource[key] => value or nil
+ #
+ # Returns the value associated with the given meta-data key. Key is
+ # usually a string.
+ #
+ def []( key )
+ @mdata[key]
end
# call-seq:
# method_missing( symbol [, *args, &block] ) => result
#