grab 0.0.3 → 0.0.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 (3) hide show
  1. data/lib/grab.rb +11 -14
  2. data/lib/grab/version.rb +1 -1
  3. metadata +2 -2
@@ -1,23 +1,20 @@
1
1
  require "grab/version"
2
2
 
3
3
  module Grab
4
- class ::Hash
5
- alias_method :orig_values, :values
6
-
7
- def grab(*keys)
8
- keys.map { |k| self.fetch(k) }
9
- end
4
+ def grab(*keys)
5
+ keys.map { |k| self.fetch(k) }
6
+ end
10
7
 
11
- def values(*args)
12
- if args.empty?
13
- orig_values
14
- else
15
- args.map { |k| self[k] }
16
- end
17
- end
8
+ def values(*args)
9
+ args.map { |k| self[k] }
18
10
  end
19
11
  end
20
12
 
21
13
  class Hash
22
14
  include Grab
23
- end
15
+
16
+ def values(*args)
17
+ args = keys if args.empty?
18
+ super
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module Grab
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-07 00:00:00.000000000 Z
12
+ date: 2012-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec