active_enum 1.0.0.rc7 → 1.0.0.rc8

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: 5c79754f5d68c12d7955e1a77e870612ffb1fdb62cc65681e50efc137da125ba
4
- data.tar.gz: e0604ad18f10935d8111491b18481e3b273b7d6d064c0284c41c02836cadff3c
3
+ metadata.gz: 906926ead31439e2c3457cf32e453bf6c6a342245a6e8f0ce1d1debd6fd7b539
4
+ data.tar.gz: 13dd1539bded32f57ba862d4e0d068d6d3d0e7aae22bb8fe1078d6e9c823d261
5
5
  SHA512:
6
- metadata.gz: '07383e22c02937744c155c72e0c35333c03169f7f3807dfd54765f490a225035ecd24017664fe7b1274c134422e164b12d4fc1a18f57b227f649b93bb166c3b2'
7
- data.tar.gz: 8bd02a86d9a478ec1bf1cbdf76f28fa6d673b00c61f2edddf6a9c3d90782a33986087ff8a3cf789ab439ab58b60227f3f7c36c4ab5ab097ee6b6430bff119119
6
+ metadata.gz: 46d4c12f04dd2affd956488081f0735a9b19767ae4b370a912cf0ef31779a01d3c398da082bd1bb03e22156ccd647ace3eb54ed95a9628e81847299fdf8e0fc0
7
+ data.tar.gz: 3b362e15afb2b1cb5f2215577605027eacc3b3d15252bdca4e664baf8259c2caa72b50bac9314662323eb60869731b2a7385c84290dd239e838f5f1f5ac70182
@@ -76,7 +76,7 @@ module ActiveEnum
76
76
  alias_method :[], :get
77
77
 
78
78
  def include?(value)
79
- !get(value).nil?
79
+ !get_value(value, false).nil?
80
80
  end
81
81
 
82
82
  # Access any meta data defined for a given id or name. Returns a hash.
@@ -88,12 +88,12 @@ module ActiveEnum
88
88
  private
89
89
 
90
90
  # Access value row array for a given id or name value.
91
- def get_value(index)
91
+ def get_value(index, raise_on_not_found = ActiveEnum.raise_on_not_found)
92
92
  if index.is_a?(Integer)
93
93
  store.get_by_id(index)
94
94
  else
95
95
  store.get_by_name(index)
96
- end || (ActiveEnum.raise_on_not_found ? raise(ActiveEnum::NotFound, "#{self} value for '#{index}' was not found") : nil)
96
+ end || (raise_on_not_found ? raise(ActiveEnum::NotFound, "#{self} value for '#{index}' was not found") : nil)
97
97
  end
98
98
 
99
99
  def id_and_name_and_meta(hash)
@@ -1,3 +1,3 @@
1
1
  module ActiveEnum
2
- VERSION = '1.0.0.rc7'
2
+ VERSION = '1.0.0.rc8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc7
4
+ version: 1.0.0.rc8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Meehan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-13 00:00:00.000000000 Z
11
+ date: 2020-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport