to_dots 0.2.1 → 0.2.2

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
- SHA1:
3
- metadata.gz: 5673a3535412cedc4cc00c4e6f38894a963fd957
4
- data.tar.gz: 747b4cf5db79264a77b1d262ab7f061d98c983c6
2
+ SHA256:
3
+ metadata.gz: ed6c85e7adc7219b143c21f03779747ea25391e450aff15c63b4dacdeb09e574
4
+ data.tar.gz: a4aa785461ea26e642fdabb6ba5ae28762ba39b4cedd78ea77ebe434d45712a7
5
5
  SHA512:
6
- metadata.gz: f293fcbd46d14ff355472049ba8d26fe4cd7800dabb5ee53eb5e08036bf7ee5d291b7f3a15054fa938588c6094380c1265c51ef99aba61eda36fbe9e30d6d8b2
7
- data.tar.gz: 2365ceb2f856ee216a6768b5eca4bd40d2760049c888f9fa67bfa2a141ad2a3ed3d658d1bbd544bc21a4553350c32679eb2939b125cd219df4b23c6f35d56e39
6
+ metadata.gz: b9a7e1c2d8f1da1ce08e0ed56fccfcf728e756e35a3d264fdf5d5a3765580e56844962b639c6823435a3eb6caf1f5190d8eb6a47de2d626f430d044d20dbf19b
7
+ data.tar.gz: 76c4942055c1b28f3389ab2646beda8eb09485c81521dbad41268d2d93639be63ac36f704105b4ebd8807e84eaad12e932dab218306b39bc78f1692d598dc1e7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- to_dots (0.2.0)
4
+ to_dots (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module ToDots
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/to_dots.rb CHANGED
@@ -4,14 +4,13 @@ require_relative './array'
4
4
 
5
5
  module ToDots
6
6
  def self.to_dots(object, result = [], prefix = '')
7
- case object
8
- when ::Hash
7
+ if object.respond_to?(:to_hash)
9
8
  object.each do |key, value|
10
9
  to_dots(value, result, "#{prefix}#{'.' unless prefix.empty?}#{key}")
11
10
  end
12
- when ::Array
13
- object.each_with_index do |value, index|
14
- to_dots(value, result, "#{prefix}")
11
+ elsif object.is_a?(Array)
12
+ object.each do |value|
13
+ to_dots(value, result, prefix.to_s)
15
14
  end
16
15
  else
17
16
  result << "#{prefix}.#{object}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_dots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Fowler
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-04 00:00:00.000000000 Z
11
+ date: 2023-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,7 +79,7 @@ homepage: http://github.com/fzf/to_dots
79
79
  licenses:
80
80
  - MIT
81
81
  metadata: {}
82
- post_install_message:
82
+ post_install_message:
83
83
  rdoc_options: []
84
84
  require_paths:
85
85
  - lib
@@ -94,9 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.5.2
99
- signing_key:
97
+ rubygems_version: 3.1.2
98
+ signing_key:
100
99
  specification_version: 4
101
100
  summary: Converts a Hash or Array into dot strings
102
101
  test_files: []