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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bitwise_attribute.rb +4 -4
- data/lib/bitwise_attribute/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edc8d43a0b14e79d054f640818259e8b1319c0e03c0298e0b30a945af8806c5a
|
4
|
+
data.tar.gz: fcd3223fdb12a3c3a6e88def6ef532a7408c2da995ba69da8cd697fd5e973a57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 102e858e4fcabc19446bea8ef839543a5bdc3b37bb09ba5363bdfb4685667e71f6a784d8c61f33facf8f12525839d4fafd38f65b8bf41dfaf7a60389596926a9
|
7
|
+
data.tar.gz: 7beacff8966e4b4f27ba801c0989d11e2d93975b5c4ac2958f63d797cafdd68fa0d3433273feb89cd29fdcaec5b255312c1e23e37dc5297e8808ebe12e5362e4
|
data/Gemfile.lock
CHANGED
data/lib/bitwise_attribute.rb
CHANGED
@@ -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
|
82
|
-
raise(ArgumentError, "Unknown value #{value}!") unless mapping[value]
|
81
|
+
values = values.map(&:to_sym).compact.uniq
|
83
82
|
|
84
|
-
|
85
|
-
|
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)
|