tiny_dot 3.0.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tiny_dot.rb +6 -1
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f31f44aa3ecf2c601378a248041012313341a63f75db817baa6df5d82be0151e
4
- data.tar.gz: 1787bff26e5ba21dfab2f696aa33bd4f17e0b35100073963db99e348e09081bc
3
+ metadata.gz: bfdf22071f9f96708a8ef78bb8a0a0560e177bead5813a8f3a96f5d570bfcb26
4
+ data.tar.gz: 804dd96f4668069a55e3351688de2549eafabb6846164526ab29582e6fabb84c
5
5
  SHA512:
6
- metadata.gz: 9ec17f00dde5f6a9df6c7a8cb431b4bc3a349a5f84c8ffba1cbcea6b720ec1764cd635183132d6590e71e34ad49c84417b6c051bda6220bd44cb12dc7031c230
7
- data.tar.gz: 25e0fc3511f15e829a886cfb9c29d7fce6d891c2af8d1032ba39fc5a062da8efbe8d6224d5091ad4923f700fae51ab64ff59974dcb89bdaca820e210b6a08c8c
6
+ metadata.gz: 860053a3e01e0b8b40faf0d17fe1adf121145231463eb640b796a6cad59ccb4a54dc86bc7c02558c2e5f81cc20ac16badd7dfd0372254a2949bb5d336f0ea097
7
+ data.tar.gz: 23019cb6b857e282f9565d1749c8107aed418c239e569115272c634bbdbd5b8fc7e2b8fe23761926affcc98ac6a80c638a13c388ea875c74af7713abcf049bb0
data/lib/tiny_dot.rb CHANGED
@@ -49,11 +49,16 @@ module TinyDot
49
49
  _hash_to_struct(yaml)
50
50
  end
51
51
 
52
- def self.from_json(json_string)
52
+ def from_json(json_string)
53
53
  json = Oj.load(json_string)
54
54
  _hash_to_struct(json)
55
55
  end
56
56
 
57
+ def from_csv(csv_string)
58
+ data = CSV.parse(csv_string, headers: true)
59
+ data.map { |row| _hash_to_struct(row.to_hash) }
60
+ end
61
+
57
62
  def self.from_hash(hash)
58
63
  _hash_to_struct(json)
59
64
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_dot
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-27 00:00:00.000000000 Z
11
+ date: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: a tiny read/write dot notation wrapper for Hash, JSON, YAML, and ENV
14
14
  email: jefflunt@gmail.com
@@ -36,7 +36,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
38
  requirements: []
39
- rubygems_version: 3.4.1
39
+ rubygems_version: 3.3.7
40
40
  signing_key:
41
41
  specification_version: 4
42
42
  summary: want to have easy dot notation access to data that comes from Hashes, JSON,