true_table 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/true_table/version.rb +1 -1
- data/lib/true_table.rb +7 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ec9c37621fb36832b5492cc2b467541ad646056fa245ed701c30a94c900028b
|
4
|
+
data.tar.gz: 265b809a637e10431299f01f8a209bd038909c6d35bad8843d66763fe3fbcf23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7ef3be0f82f07c73d9dfeec1cdedc15f79badcd6099de58f0292bda033a80ae242dee794d0e991b68e4bbb4d700d7115af677c03af55965389b47e1fb88c61b
|
7
|
+
data.tar.gz: 4db2c8cfefc89afe2b2820c6e77221b90c36e227b53b700d60ae07b9b873d7b1f77490b341fe88c6d421e63997ecb0743589d3fea3b9bf395e6e7f0faaf6e8ce
|
data/lib/true_table/version.rb
CHANGED
data/lib/true_table.rb
CHANGED
@@ -263,9 +263,14 @@ class TrueTable < Array
|
|
263
263
|
end
|
264
264
|
|
265
265
|
# Returns a hash representation of the table using the values of the
|
266
|
-
# first column as hash keys
|
266
|
+
# first column as hash keys. If a block is given, the results of the block
|
267
|
+
# on each element of the array will be used as key => value pair.
|
267
268
|
def to_h
|
268
|
-
|
269
|
+
if block_given?
|
270
|
+
super
|
271
|
+
else
|
272
|
+
super { |row| [row.values.first, row] }
|
273
|
+
end
|
269
274
|
end
|
270
275
|
|
271
276
|
# Returns only values, without any headers (array of arrays)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: true_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Simple and intuitive tabular data type
|
14
14
|
email: db@dannyben.com
|
@@ -32,14 +32,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
32
32
|
requirements:
|
33
33
|
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
35
|
+
version: '3.0'
|
36
36
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
requirements: []
|
42
|
-
rubygems_version: 3.
|
42
|
+
rubygems_version: 3.4.13
|
43
43
|
signing_key:
|
44
44
|
specification_version: 4
|
45
45
|
summary: Simple and intuitive tabular data type
|