to_dots 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ee214252a981ffb0bc2f776db6206c35542dcba
4
- data.tar.gz: 0d0c9c86c35dcfe99f7547e6f71b321d6f9050d7
3
+ metadata.gz: 5a8988e3d224fac93c0498c0b32d3024fd431e90
4
+ data.tar.gz: 2883d756770d337e2b6a2396907e066a0fd1494b
5
5
  SHA512:
6
- metadata.gz: e9472382dd010af3e70c44654be72116f7861d1032708f0b3c273910270619792c63d20f6874d77c7028a309cfd3de7dd359c1b073a03f8b37b0dc8639bfd98a
7
- data.tar.gz: fc97e25f973d76dfaca8e96db6a890949689de37fe6118014001849e59f00dcd5e640b796971fa8652b8c97f3a48f6747244678abb0040174b44fbc74d878a6d
6
+ metadata.gz: 9695194cc507d4986acd6a0f5798b1541b812698b8468c435abb861335f1a3e0653a7ed880d4b9ddc88f97c6f164edfdf8e5301ff119a3b26ebc80b021bd1359
7
+ data.tar.gz: 29b47fc10b965317962dc4ddb93cc8e2d43b47923629bb5135ad245d907557e500e95468f0afefd790e3ebe418167dc6bdcfe11d697af0a8bc806ec7428476ec
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ *.gem
data/lib/array.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class Array
2
2
  def to_dots
3
- HashToDots.to_dots(self)
3
+ ToDots.to_dots(self)
4
4
  end
5
5
  end
data/lib/hash.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class Hash
2
2
  def to_dots
3
- HashToDots.to_dots(self)
3
+ ToDots.to_dots(self)
4
4
  end
5
5
  end
@@ -1,3 +1,3 @@
1
1
  module ToDots
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/to_dots.rb CHANGED
@@ -1,13 +1,15 @@
1
1
  require "to_dots/version"
2
+ require 'hash'
3
+ require 'array'
2
4
 
3
5
  module ToDots
4
6
  def self.to_dots(object, result = [], prefix = '')
5
7
  case object
6
- when Hash
8
+ when ::Hash
7
9
  object.each do |key, value|
8
10
  to_dots(value, result, "#{prefix}#{'.' unless prefix.empty?}#{key}")
9
11
  end
10
- when Array
12
+ when ::Array
11
13
  object.each_with_index do |value, index|
12
14
  to_dots(value, result, "#{prefix}")
13
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_dots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Fowler