dyoder-filebase 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/filebase/attributes.rb +13 -3
- metadata +1 -1
data/lib/filebase/attributes.rb
CHANGED
@@ -9,11 +9,21 @@ module Attributes
|
|
9
9
|
|
10
10
|
def attributes ; @attrs ||= {} ; end
|
11
11
|
|
12
|
+
def has_key?( key ) ; attributes.has_key?( key.to_s ) ; end
|
13
|
+
|
14
|
+
def delete( key ) ; attributes.delete( key.to_s ) ; end
|
15
|
+
|
12
16
|
def method_missing(name,*args)
|
17
|
+
name = name.to_s
|
13
18
|
case args.length
|
14
|
-
when 0 then get( name
|
15
|
-
when 1
|
16
|
-
|
19
|
+
when 0 then get( name )
|
20
|
+
when 1
|
21
|
+
if name[-1,1] == '='
|
22
|
+
set( name[0..-2], args[0] )
|
23
|
+
else
|
24
|
+
super
|
25
|
+
end
|
26
|
+
else super
|
17
27
|
end
|
18
28
|
end
|
19
29
|
|