grab 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/grab.rb +11 -14
- data/lib/grab/version.rb +1 -1
- metadata +2 -2
data/lib/grab.rb
CHANGED
@@ -1,23 +1,20 @@
|
|
1
1
|
require "grab/version"
|
2
2
|
|
3
3
|
module Grab
|
4
|
-
|
5
|
-
|
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
|
-
|
12
|
-
|
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
|
-
|
15
|
+
|
16
|
+
def values(*args)
|
17
|
+
args = keys if args.empty?
|
18
|
+
super
|
19
|
+
end
|
20
|
+
end
|
data/lib/grab/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2012-09-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|