easy_enum 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 725e5b37a0c852147b6051b26a921a94021cc45ff2a2690a847b1ff5218970ff
4
- data.tar.gz: 55a552d7ddd64c2897739526f87eb7b9e5e752265bee8cd8378d6382fc85e8c1
3
+ metadata.gz: ca22fe319521f113ccf89ffa7c57e37e5ec169d855dc2b399238bb2acf0b47d0
4
+ data.tar.gz: b90a020a067577b459acbf42791f077db7e50640db2c2047ce9eab0bb34ea4b7
5
5
  SHA512:
6
- metadata.gz: 12e0fd11be0a44da274f7af9af3a89f45b1fe8d9a7e9c2e462bc12cae6ab235d2b9f928f225b265fe2c969b07dc72d245a8e14d2db166ca83795e02abd64cda3
7
- data.tar.gz: edfe6d85dd00a9aa0226b9636ecc03b25e2f6be26752663c24839a33157f1ad94cef84b899d12e510e3592a313b740d09f33e285c899b12fbb7715cfeaa182b7
6
+ metadata.gz: f8c37e4a59f9a323ebadc99675ec63be8d3cf58e017d2258c98723b6864546d96453225b430fb6fb82c8c2751ccda79b95e6ed08a423024877d4a01dc77d2a57
7
+ data.tar.gz: 96fc09cd3949833b3a8d79feea33c4c2db1179c57ea4ad97eb809c87aab616332df9cbb97d7bd74bb5598d3f74a14a3798e3137b6579eefab7ca5c1f60d583fe
@@ -87,7 +87,7 @@ module EasyEnum
87
87
  end
88
88
  end
89
89
 
90
- def method_missing(method, *args) # rubocop:disable Style/MissingRespondToMissing
90
+ def method_missing(method, *args)
91
91
  self.class.easy_enum.each do |key, val|
92
92
  return val == value if method == "#{key}?".to_sym
93
93
  end
@@ -95,10 +95,22 @@ module EasyEnum
95
95
  super
96
96
  end
97
97
 
98
- def self.method_missing(method, *args) # rubocop:disable Style/MissingRespondToMissing
98
+ def respond_to_missing?(method, *)
99
+ return true if self.class.easy_enum.keys.map { |key| "#{key}?".to_sym }.include?(method)
100
+
101
+ super
102
+ end
103
+
104
+ def self.method_missing(method, *args)
99
105
  return key(method) if keys.include?(method)
100
106
 
101
107
  super
102
108
  end
109
+
110
+ def self.respond_to_missing?(method, *)
111
+ return true if keys.include?(method)
112
+
113
+ super
114
+ end
103
115
  end
104
116
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyEnum
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Roth
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-15 00:00:00.000000000 Z
11
+ date: 2020-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.75.0
61
+ version: 0.81.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.75.0
68
+ version: 0.81.0
69
69
  description: Turn any Ruby class in an easy to use enum
70
70
  email:
71
71
  - marco.roth@intergga.ch