power_enum 3.1.0 → 3.2.0
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 +4 -4
- data/README.markdown +4 -0
- data/lib/power_enum/enumerated.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7da8f53dc5a5bc6ff1e54fd46004e7dff2b4e222
|
4
|
+
data.tar.gz: 432e743af0a341c88a125947f59ad7b541d0b698
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10c9c2ff2a7e5bea79e657412ba8e3cad734c1fc56f26017a65806010543530cff46cdb6f3cc0611c10fafbb94269f5ebad90f55df39e6371782ca9c0f6becc2
|
7
|
+
data.tar.gz: d33c0d64cdfc27f16cbe9f96ea11cff21e36099ccd9f8e942681ce508cd1461745f619ad9d0a788e271459e160002bb4119ab34a38c88cdc044d143fbf1efe48
|
data/README.markdown
CHANGED
@@ -341,6 +341,10 @@ other value.
|
|
341
341
|
`BookingStatus.all` returns an array of all BookingStatus records that match the `:conditions` specified in
|
342
342
|
`acts_as_enumerated`, in the order specified by `:order`.
|
343
343
|
|
344
|
+
##### all_except(*items)
|
345
|
+
|
346
|
+
`BookingStatus.all_except(arg1, arg2)` returns an array of all BookingStatus records with the given items filtered out.
|
347
|
+
|
344
348
|
##### active
|
345
349
|
|
346
350
|
`BookingStatus.active` returns an array of all BookingStatus records that are marked active. See the `active?` instance
|
@@ -194,6 +194,11 @@ module PowerEnum::Enumerated
|
|
194
194
|
all.map { |item| item.name_sym }
|
195
195
|
end
|
196
196
|
|
197
|
+
# Returns all except for the given list
|
198
|
+
def all_except(*excluded)
|
199
|
+
all.find_all { |item| !(item === excluded) }
|
200
|
+
end
|
201
|
+
|
197
202
|
# Enum lookup by Symbol, String, or id. Returns <tt>arg<tt> if arg is
|
198
203
|
# an enum instance. Passing in a list of arguments returns a list of
|
199
204
|
# enums. When called with no arguments, returns nil.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: power_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trevor Squires
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2018-03-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|