enumerize 2.6.0 → 2.6.1
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 -0
- data/lib/enumerize/base.rb +1 -1
- data/lib/enumerize/integrations/rspec.rb +1 -0
- data/lib/enumerize/version.rb +1 -1
- data/test/base_test.rb +24 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07d568d0eb005ebea8b0ded7cb260d6c7792b1d676bd46f8441c7e33445e366c
|
4
|
+
data.tar.gz: b811acb983e8fac641fb2b9f9340089e8fd6149b1431af7f12446cb5203c39e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b68609dbbc3eede78b640395ef59bf149f1bf00d7b55f2b03a1397430f4e8816bd6a19bdfe06151e28fb1a64a9595fe48893810b015899b00d4991af6539f5d7
|
7
|
+
data.tar.gz: 3999ab755693815c52779ca0124f6aec629a1dd639c41d33330211b0948f6f9d4aa3d79a3f20713bb99a508afa5b7e2b776a0465fe0c3c5a3c250043bbdfc0aa
|
data/CHANGELOG.md
CHANGED
data/lib/enumerize/base.rb
CHANGED
data/lib/enumerize/version.rb
CHANGED
data/test/base_test.rb
CHANGED
@@ -227,4 +227,28 @@ class BaseTest < MiniTest::Spec
|
|
227
227
|
|
228
228
|
klass.new('arg1', key_word_argument: 'kwargs1')
|
229
229
|
end
|
230
|
+
|
231
|
+
it 'allows initializing object without keyword arguments' do
|
232
|
+
parent_klass = Class.new do
|
233
|
+
attr_reader :arguments
|
234
|
+
|
235
|
+
def initialize(arguments)
|
236
|
+
@arguments = arguments
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
klass = Class.new(parent_klass) do
|
241
|
+
extend Enumerize
|
242
|
+
|
243
|
+
def initialize(arguments)
|
244
|
+
super
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
params = { 'string_key' => 1, symbol_key: 2 }
|
249
|
+
|
250
|
+
object = klass.new(params)
|
251
|
+
|
252
|
+
expect(object.arguments).must_equal params
|
253
|
+
end
|
230
254
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enumerize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Nartimov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -99,7 +99,7 @@ homepage: https://github.com/brainspec/enumerize
|
|
99
99
|
licenses:
|
100
100
|
- MIT
|
101
101
|
metadata: {}
|
102
|
-
post_install_message:
|
102
|
+
post_install_message:
|
103
103
|
rdoc_options: []
|
104
104
|
require_paths:
|
105
105
|
- lib
|
@@ -114,8 +114,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
|
-
rubygems_version: 3.
|
118
|
-
signing_key:
|
117
|
+
rubygems_version: 3.1.6
|
118
|
+
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Enumerated attributes with I18n and ActiveRecord/Mongoid/MongoMapper support
|
121
121
|
test_files:
|