bitwise_attribute 0.3.2 → 0.3.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: 210d7110d3dee1b1b94d976069ac36b475bee678932bc8ed210a21db00b517e1
4
- data.tar.gz: 05abd969cd0f943e60763c757aa3dc1355af3b274999081cd69f5ecea64967ed
3
+ metadata.gz: edc8d43a0b14e79d054f640818259e8b1319c0e03c0298e0b30a945af8806c5a
4
+ data.tar.gz: fcd3223fdb12a3c3a6e88def6ef532a7408c2da995ba69da8cd697fd5e973a57
5
5
  SHA512:
6
- metadata.gz: 496aef69f89b52d018c44d31a7d06033b7098d5e013ad854928353675a41045d416ec92d3f7a0e28c845c12073b31ce4be488fb14ee661d47938262f4cad9bbc
7
- data.tar.gz: 14c79726d07f71ba72daf0a35ae189c26daff795c221db6028a567c153c5002b40470a9c5c344c2f9c17c66aa9835e5bf4fa2e2a19e52da554aed4d103e29fb1
6
+ metadata.gz: 102e858e4fcabc19446bea8ef839543a5bdc3b37bb09ba5363bdfb4685667e71f6a784d8c61f33facf8f12525839d4fafd38f65b8bf41dfaf7a60389596926a9
7
+ data.tar.gz: 7beacff8966e4b4f27ba801c0989d11e2d93975b5c4ac2958f63d797cafdd68fa0d3433273feb89cd29fdcaec5b255312c1e23e37dc5297e8808ebe12e5362e4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitwise_attribute (0.3.2)
4
+ bitwise_attribute (0.3.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -78,11 +78,11 @@ module BitwiseAttribute
78
78
  def value_setter(mask_column, values, mapping)
79
79
  send("#{mask_column}=", 0)
80
80
 
81
- values.each do |value|
82
- raise(ArgumentError, "Unknown value #{value}!") unless mapping[value]
81
+ values = values.map(&:to_sym).compact.uniq
83
82
 
84
- send("#{mask_column}=", send(mask_column) | mapping[value])
85
- end
83
+ values &= mapping.keys
84
+
85
+ values.each { |value| send("#{mask_column}=", send(mask_column) | mapping[value]) }
86
86
  end
87
87
 
88
88
  # Return if value is present in mask (raw value)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BitwiseAttribute
4
- VERSION = '0.3.2'
4
+ VERSION = '0.3.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitwise_attribute
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Otero