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.
Files changed (2) hide show
  1. data/lib/filebase/attributes.rb +13 -3
  2. metadata +1 -1
@@ -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.to_s )
15
- when 1 then set( name.to_s[0..-2], args[0] )
16
- else raise ArgumentError.new("#{args.length} for 0 or 1")
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyoder-filebase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Yoder