power_enum 3.1.0 → 3.2.0

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
  SHA1:
3
- metadata.gz: 62f78fa7a580eaeb3f024857990083633b16bb84
4
- data.tar.gz: e2d6b28e0ac710338ac343cbc6f82ca889eeb258
3
+ metadata.gz: 7da8f53dc5a5bc6ff1e54fd46004e7dff2b4e222
4
+ data.tar.gz: 432e743af0a341c88a125947f59ad7b541d0b698
5
5
  SHA512:
6
- metadata.gz: 9df60352bf0960811460e14c38a97e792369f9d46cd4378c95ca7983f384abb38e0f018870802f74c12f24713af152e896cf8955c615fbb23f7ed6cbdcf1441c
7
- data.tar.gz: 27ef578eb74cfbef342cd50c310f72f3f9c16fc49c8c13e9d2f325dbe7cf1cca06523765adce1ffd1ed31e6379772ad974210932f54b970aefb51b76a8fcdc6c
6
+ metadata.gz: 10c9c2ff2a7e5bea79e657412ba8e3cad734c1fc56f26017a65806010543530cff46cdb6f3cc0611c10fafbb94269f5ebad90f55df39e6371782ca9c0f6becc2
7
+ data.tar.gz: d33c0d64cdfc27f16cbe9f96ea11cff21e36099ccd9f8e942681ce508cd1461745f619ad9d0a788e271459e160002bb4119ab34a38c88cdc044d143fbf1efe48
@@ -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.1.0
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: 2017-12-11 00:00:00.000000000 Z
14
+ date: 2018-03-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler