seq_as_enum 0.1.0 → 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 +2 -0
- data/README.md +2 -0
- data/lib/seq_as_enum/version.rb +1 -1
- data/lib/seq_as_enum.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ed043cc3fc1e665375938158a59ea4f383fdd950c92c9ed1dd83eee62955efd
|
4
|
+
data.tar.gz: 99db0b6e544984f67a1fb47fcad0a08bcb15f0461b07200b65f6bfd5093b3c79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acc00518b38c8be7670fdc9b1d6ed6ab9e066099a04dd04e1723649ded370269752d8499e7138e81201a310b5d6f9668a691048e1303c7c9f07d48b06a5c8594
|
7
|
+
data.tar.gz: 1ab81b07529fcd49895fed3a21d57f4d74b118aadfc5a8d008043047278ccbf015c4b9278917f651179a49da4f5736855c896d4887a9374afb576c1246f6b272
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -123,6 +123,8 @@ class AwesomeCsv
|
|
123
123
|
end
|
124
124
|
```
|
125
125
|
|
126
|
+
NOTE: If you use Ruby 3.1.x or 3.0.x, data_as will use Struct instead of Data.
|
127
|
+
|
126
128
|
## Development
|
127
129
|
|
128
130
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/seq_as_enum/version.rb
CHANGED
data/lib/seq_as_enum.rb
CHANGED
@@ -14,7 +14,7 @@ module SeqAsEnum
|
|
14
14
|
|
15
15
|
if data_as
|
16
16
|
class_name = "#{data_as}Data"
|
17
|
-
data_class = Data.define(*names)
|
17
|
+
data_class = const_defined?(:Data) ? Data.define(*names) : Struct.new(*names, keyword_init: true)
|
18
18
|
const_set!(class_name, data_class)
|
19
19
|
data = data_class.new(**key_values)
|
20
20
|
const_set!(data_as, data)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seq_as_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Junichi Ito
|
@@ -10,7 +10,7 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2023-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Provide enum like sequences as constants
|
13
|
+
description: Provide enum like sequences as constants.
|
14
14
|
email:
|
15
15
|
- me@jnito.com
|
16
16
|
executables: []
|
@@ -45,15 +45,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 3.
|
48
|
+
version: 3.0.0
|
49
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
|
-
rubygems_version: 3.4.
|
55
|
+
rubygems_version: 3.4.10
|
56
56
|
signing_key:
|
57
57
|
specification_version: 4
|
58
|
-
summary: Provide enum like sequences as constants
|
58
|
+
summary: Provide enum like sequences as constants.
|
59
59
|
test_files: []
|