opt_struct 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opt_struct/class_methods.rb +2 -2
- data/lib/opt_struct/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef6cb2533d486038390ac0975e38f6c0d3e9486c8c213326f48caf58c57dfb09
|
4
|
+
data.tar.gz: 98c38c235c3e24588f9a3efb7d69ac4e40da9d7d6650ebb1a0aca3c669240f45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f7346d74b2ddcdef6ff61ba638e794247fbc714c9e796a0f13297fae9d77d7482f452e43f5b2830c54129b3d6cf22f19d8315d75c360d1eb575027325a33337
|
7
|
+
data.tar.gz: cbeba0f215a42989eb6124fe095d6d6332fe015b844f972ba63aa15b085b0f7df6812751c736867743f86029187b829e44fd9d8aed88d78e8087076e78192e06
|
@@ -43,8 +43,8 @@ module OptStruct
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def option(key, default = nil, required: false, **options)
|
46
|
-
default
|
47
|
-
add_defaults key => default
|
46
|
+
default ||= options[:default]
|
47
|
+
add_defaults key => default if default || options.key?(:default)
|
48
48
|
add_required_keys key if required
|
49
49
|
option_accessor key, **options
|
50
50
|
end
|
data/lib/opt_struct/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opt_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Zulauf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Struct with support for keyword params and mixin support
|
14
14
|
email:
|
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0'
|
45
45
|
requirements: []
|
46
|
-
rubygems_version: 3.
|
46
|
+
rubygems_version: 3.2.3
|
47
47
|
signing_key:
|
48
48
|
specification_version: 4
|
49
49
|
summary: The Option Struct
|