enum_ish 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52aa581f25b17fc1890f71cba2669c5cd12c1507f7282ab8f1c1dbb2c1680d7e
4
- data.tar.gz: 7993d724365d6a906874c8cf0786ab25a3b551b1ec9790971585d37b71a90845
3
+ metadata.gz: 17969b00055223b32c415d1dffeb22855a8efa1de17aa46fbf0cf51114f65de5
4
+ data.tar.gz: 9fcc271cbd49bc7ad4e670b88a3c8120f21a8e6b38d8192b1705d7fd94811f85
5
5
  SHA512:
6
- metadata.gz: a6d1ac67ef5a55663ddd0c784225b3c3c0f4f5322ad71d066ed2260c305997ae1a384254ace06dea5d0bd076440d315733520ac4afc070e3c2bd19f7debc1f86
7
- data.tar.gz: da632eb455b2915e5c7116544fd3c94033c2eabf6b866c938bb2c869090f026c27d8f564964fe0ae2b279203a69f0419b6083ca0b026e40da3d4fcc3ad5fc19a
6
+ metadata.gz: b3449674e452b6d28fb71ce522fff9ffcece57d56c396e09911a2d21aa23071ea633df22b02fd1691e5c51d269c19ebdebbfadeee48ef08e106153fbc755194c
7
+ data.tar.gz: ffe384c257c5f77bd684b17fcdba46f4e1b4cc3486d1d1dc6ef3304f8b8c0a950c42f68be4255cc62e495279279804ef6fb74ebbbdcfe64627e491430525bc2c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.2.2
4
+
5
+ * Support assignment of string in addition to symbol.
6
+
3
7
  ## 1.2.1
4
8
 
5
9
  * Fix internal module name.
@@ -7,8 +7,9 @@ module EnumIsh
7
7
  end
8
8
 
9
9
  def cast(value)
10
- if @mapping.has_key?(value)
11
- value
10
+ return if value.nil?
11
+ if @mapping.has_key?(value.to_s.to_sym)
12
+ value.to_s.to_sym
12
13
  elsif @mapping.has_value?(value)
13
14
  @mapping.key(value)
14
15
  else
@@ -1,3 +1,3 @@
1
1
  module EnumIsh
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_ish
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshikazu Kaneta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-05 00:00:00.000000000 Z
11
+ date: 2019-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport