swifter_enum 0.9.2 → 0.9.3

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: 4147b58f08c0633761d7721503972bf4478d7b6295a634186810ebe146416bf8
4
- data.tar.gz: 9fa17a88143342a5637866c8ac599a5bc9adb6e7ff3f28293aefac6957ef3767
3
+ metadata.gz: c619ac4afac5bcbad7b49e421d04faa75bd558611297effa54c992a9509b7d7f
4
+ data.tar.gz: 2fa59214a51e2417b6834362fcce525f5ca10a4fdf962261576252a0f6f6071f
5
5
  SHA512:
6
- metadata.gz: c322303bcf61cd899f66b0e444de08a4d4826cc787d2ef5fa53bda9f81b15130d4da4b6d63455c1215f5ef14b3cb523ac6112b8d62d4f61da069336e3d69c5e0
7
- data.tar.gz: 7e53b29f10e6908f3f9bf3f282c98d6e40f9a5c6bd5103d1beee337870c2ac53430cc3c0d0818c021731178c19e236d261573aa65fe6ce9b0d1a1b9624563e8a
6
+ metadata.gz: 02d2882937c808e0c9c652ee7cf85cbea7a0d4425e33e7656718ac906bd475a2173ab5ec8d0f79d1a61b9ef8f634d76696429eac7500e7da33d039adb52a7038
7
+ data.tar.gz: 5f4186f334a5f9fedb4e670a8f0dea82872e9d9733e96f44c0f9867438effa96d1408b85fa2f13d628487cf922ca5ee763f2c36e2c2dc963ce0eea431cf7fb1e
@@ -6,10 +6,10 @@ module SwifterEnum
6
6
  def set_values(input)
7
7
  case input
8
8
  when Hash
9
- @values = input
9
+ @values = input.freeze
10
10
  when Array
11
11
  validate_array_elements!(input)
12
- @values = input.map { |item| [item.to_sym, item.to_s] }.to_h
12
+ @values = input.map { |item| [item.to_sym, item.to_s] }.to_h.freeze
13
13
  else
14
14
  raise ArgumentError, "Input must be a Hash or an Array of symbols or strings"
15
15
  end
@@ -10,7 +10,7 @@ class <%= class_name %>Enum < SwifterEnum::Base
10
10
  #if you're using an array of symbols (or strings), then your database column should be of string type
11
11
  # e.g. set_values [:active,:passive]
12
12
 
13
- set_values <<Your Values Here>>
13
+ set_values ##Your Values Here##
14
14
 
15
15
  # you can now define methods on the enum
16
16
  # this would allow you to access YourModel.<%= file_name %>.squared
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SwifterEnum
4
- VERSION = "0.9.2"
4
+ VERSION = "0.9.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swifter_enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Jonson