rafini 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +2 -2
- data/lib/rafini/empty.rb +1 -1
- data/lib/rafini/hash.rb +3 -1
- data/lib/rafini/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fee7de23e9fb3ef805b34056f54e5a7a944671c
|
4
|
+
data.tar.gz: 5b97e29bfa82799e494c49b9e8574a5a6c6a5410
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2722db2dba8bb97dd1d45ba93cea7b44c2715c07e4922ac480ebabaeae4c4357e88cfc77f30fd8e51541db65d7e74e95b5fb5e657a39780ea892ece68ee8d05
|
7
|
+
data.tar.gz: 02cd25f9f263d2b764d0a4a6b1d9c39098c7b9e8cd33d592a48f77253a34b40ad8eddf1fc906a60d55c92d82186a4a5c321f7583b188ff1ada437030b1207c20
|
data/README.rdoc
CHANGED
@@ -55,8 +55,8 @@ Just a collection of useful refinements.
|
|
55
55
|
# supplement
|
56
56
|
{a:'A',b:'B'}.supplement({b:'X',c:'C'},{c:'Y',d:'D'}) #=> {a:'A',b:'B',c:'C',d:'D'}
|
57
57
|
|
58
|
-
#
|
59
|
-
{a:'A',b:'B'}.
|
58
|
+
# amend
|
59
|
+
{a:'A',b:'B'}.amend({b:'X',c:'C'},{c:'Y',d:'D'}) #=> {a:'A',b:'X'}
|
60
60
|
|
61
61
|
=== using Rafini::Integer
|
62
62
|
|
data/lib/rafini/empty.rb
CHANGED
data/lib/rafini/hash.rb
CHANGED
@@ -41,7 +41,7 @@ module Rafini
|
|
41
41
|
# Ammends hash with hashes.
|
42
42
|
# Overwrites existing elements only.
|
43
43
|
# {a:'A',b:'B'}.supplement({b:'X',c:'C'},{c:'Y',d:'D'}) #=> {a:'A',b:'X'}
|
44
|
-
def
|
44
|
+
def amend(*hashes)
|
45
45
|
self.keys.each do |key|
|
46
46
|
hashes.each do |hash|
|
47
47
|
if hash.has_key?(key)
|
@@ -52,6 +52,8 @@ module Rafini
|
|
52
52
|
end
|
53
53
|
self
|
54
54
|
end
|
55
|
+
# TODO: ammend was a typo, to go away on a major revision bump.
|
56
|
+
alias ammend amend
|
55
57
|
|
56
58
|
end
|
57
59
|
end
|
data/lib/rafini/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rafini
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- carlosjhr64
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Just a collection of useful refinements.
|