flat_keys 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module FlatKeys
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/flat_keys.rb CHANGED
@@ -19,7 +19,7 @@ class Hash
19
19
  return hash
20
20
  end
21
21
 
22
- def unflat_keys(separator)
22
+ def unflat_keys(separator = '.')
23
23
  hash = {}
24
24
  self.each do |k, v|
25
25
  names = k.split(separator)
@@ -15,7 +15,7 @@ describe "flat_keys" do
15
15
  end
16
16
 
17
17
  it "should flat_keys with default separator " do
18
- {'a'=>'Letter A', 'name'=>{'fname'=>'John'}}.flat_keys('.').must_equal({'a'=>'Letter A', 'name.fname'=>'John'})
18
+ {'a'=>'Letter A', 'name'=>{'fname'=>'John'}}.flat_keys.must_equal({'a'=>'Letter A', 'name.fname'=>'John'})
19
19
  end
20
20
 
21
21
  end
@@ -27,7 +27,7 @@ describe "unflat_keys" do
27
27
  end
28
28
 
29
29
  it "should unflat with default separator " do
30
- {'a'=>'Letter A', 'name.fname'=>'John'}.unflat_keys('.').must_equal({'a'=>'Letter A', 'name'=>{'fname'=>'John'}} )
30
+ {'a'=>'Letter A', 'name.fname'=>'John'}.unflat_keys.must_equal({'a'=>'Letter A', 'name'=>{'fname'=>'John'}} )
31
31
  end
32
32
 
33
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flat_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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: 2013-02-16 00:00:00.000000000 Z
12
+ date: 2013-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake