open_hash 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -3
- data/Gemfile.lock +1 -1
- data/lib/open_hash.rb +15 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cabb37696a38c934c8530c7529961510fb6e186ca3a1303f61764099754b5f7
|
4
|
+
data.tar.gz: f0aa05e2b21858e80d3ac82ee9180d4128fbd18f14213f99b30890723148fc12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 405250c6c97f8d26a2fb07a35bf2645968e0e7d745da23e98971dbd5b4199d0eff7e2156feb249196447ef7aff9912ecf9a9e9fc54a0b86a6a18f71594de7a58
|
7
|
+
data.tar.gz: 739af567badac7eb1f6cccf5f409f89929f785a9e98327e7b5c4976d626624e358e27f6dcf4defe18ffa06ae9cc7057ef70b8b449257792bc81e5eb360028c87
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/open_hash.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class OpenHash < Hash
|
4
|
+
|
5
|
+
def initialize(hash = {})
|
6
|
+
hash.each do |key, value|
|
7
|
+
self[key] = value
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
4
11
|
def method_missing(method_name, *args, &block)
|
5
12
|
if has_key?(method_name)
|
6
13
|
self[method_name]
|
@@ -20,9 +27,15 @@ class OpenHash < Hash
|
|
20
27
|
|
21
28
|
module VERSION
|
22
29
|
MAJOR = 0
|
23
|
-
MINOR =
|
24
|
-
TINY =
|
30
|
+
MINOR = 2
|
31
|
+
TINY = 0
|
25
32
|
|
26
33
|
STRING = [MAJOR, MINOR, TINY].compact.join(".")
|
27
34
|
end
|
28
35
|
end
|
36
|
+
|
37
|
+
class Hash
|
38
|
+
def to_open_hash
|
39
|
+
OpenHash.new(self)
|
40
|
+
end
|
41
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open_hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reegan Viljoen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -55,12 +55,12 @@ files:
|
|
55
55
|
- lib/open_hash.rb
|
56
56
|
- open_hash.gemspec
|
57
57
|
- sig/open_hash.rbs
|
58
|
-
homepage:
|
58
|
+
homepage:
|
59
59
|
licenses: []
|
60
60
|
metadata:
|
61
61
|
homepage_uri: https://github.com/reeganviljoen/open_hash
|
62
62
|
source_code_uri: https://github.com/reeganviljoen/open_hash
|
63
|
-
post_install_message:
|
63
|
+
post_install_message:
|
64
64
|
rdoc_options: []
|
65
65
|
require_paths:
|
66
66
|
- lib
|
@@ -75,8 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
|
-
rubygems_version: 3.4.
|
79
|
-
signing_key:
|
78
|
+
rubygems_version: 3.4.12
|
79
|
+
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Hashes with keys and methods!
|
82
82
|
test_files: []
|