data_collector 0.6.0 → 0.7.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
  SHA256:
3
- metadata.gz: 78a054b825d99611c8f5070120c11b478975152433b3c76b9a63a6694b7c8cd0
4
- data.tar.gz: f11143808a8e1647a791b0e12e1c5855dc1589de37f7ea50c0e8789f88538774
3
+ metadata.gz: 6c364ef9791c9ac026f6c6d0e0b228d338a7753f597708485d6e66e01e07bb29
4
+ data.tar.gz: fa7bfdeffc86728354607f7a58ab0d2fce5b64603506457d4f89acb5ca1107be
5
5
  SHA512:
6
- metadata.gz: 0b3396b16e5500add7dbb8e2883e5bfd8e14ba898ce7291ed876ed1a423a59a2dc9bba42e1c96150a7119284398c58c18daf8ea7dc82844e3cee55d9ea17fe7f
7
- data.tar.gz: a7f7821eb19e50918321b8d1b47caa4ab9d04d40b2918a502f86512fbe25b8c35b4bee0705eb1044ade83cdb7f0c0f45a4023363e14c8153283ed9bdfec32f1a
6
+ metadata.gz: '071387ac380b1ec2498b233ab4e8923a414d2354779a9eb62014a5edec34fd75d0122e7d0c448f2ba4a5d43c774abc41081acd2be565b7b61af5c75dde07f7b2'
7
+ data.tar.gz: a962c642f586e08b1bf2699a8a1d042edc2a9ccbb091ae774fb12e41c4197d18c6e08fa7a7ff1fbe1db433e64391eaa93c556ec2d874fc1efdc70cfb14d677d5
@@ -32,7 +32,11 @@ module DataCollector
32
32
  unless v.nil?
33
33
  if data.has_key?(k)
34
34
  if data[k].is_a?(Array) then
35
- data[k] << v
35
+ if v.is_a?(Array)
36
+ data[k] += v
37
+ else
38
+ data[k] << v
39
+ end
36
40
  else
37
41
  t = data[k]
38
42
  data[k] = Array.new([t, v])
@@ -58,6 +62,22 @@ module DataCollector
58
62
  end
59
63
  end
60
64
 
65
+ def key?(key)
66
+ @data.key?(key)
67
+ end
68
+
69
+ def has_key?(key)
70
+ @data.key?(key)
71
+ end
72
+
73
+ def include?(key)
74
+ @data.key?(key)
75
+ end
76
+
77
+ def keys
78
+ @data.keys
79
+ end
80
+
61
81
  def raw
62
82
  @data
63
83
  end
@@ -91,7 +91,8 @@ module DataCollector
91
91
 
92
92
  output_data.compact! if output_data.is_a?(Array)
93
93
  output_data.flatten! if output_data.is_a?(Array)# || output_data.is_a?(Hash)
94
- output_data = output_data.first if output_data.is_a?(Array) && output_data.size == 1
94
+ output_data = output_data.first if output_data.is_a?(Array) && output_data.size == 1 && output_data.first.is_a?(Array)
95
+
95
96
  output_data
96
97
  end
97
98
 
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module DataCollector
3
- VERSION = "0.6.0"
3
+ VERSION = "0.7.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Celik