power_enum 3.6.0 → 3.7.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 -3
- data/VERSION +1 -1
- data/lib/power_enum/enumerated.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afdfec8c704c968a3871c9444428cb385fcc3075bb56875a4018e4cf0f9ba5c0
|
4
|
+
data.tar.gz: 640c7bde6091cbe26b8263a000cb922c0df3c2c6e113c17d0c7846305873ee67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2198b9d106a9428ae0ae1f70f1d15cc4c1874909d5870b5da43592878000791f2d0fe51e012fd6766a9bc00e4518c083430f68d1f894ece0e9a890c37a913fb4
|
7
|
+
data.tar.gz: 43e95cce4ffc0f4fe4e0fb4fe150d944fddea41bf89b530d2bcee20ff82b1bdea1783a3fc3db2580daa95086e7c51b53df650aae9ad90f83293792635b9dfd4c
|
data/README.markdown
CHANGED
@@ -29,16 +29,17 @@ At it's most basic level, it allows you to say things along the lines of:
|
|
29
29
|
|
30
30
|
```ruby
|
31
31
|
# Create a provisional booking
|
32
|
-
booking = Booking.new( :
|
32
|
+
booking = Booking.new( status: BookingStatus[:provisional] )
|
33
33
|
# This also works
|
34
|
-
booking = Booking.new( :
|
34
|
+
booking = Booking.new( status: :provisional )
|
35
35
|
# Set the booking status to 'confirmed'
|
36
36
|
booking.status = :confirmed
|
37
|
-
booking = Booking.create( :
|
37
|
+
booking = Booking.create( status: :rejected )
|
38
38
|
# And now...
|
39
39
|
booking.status == BookingStatus[:rejected] # evaluates to true
|
40
40
|
booking.status === :rejected # also evaluates to true
|
41
41
|
booking.status === [:rejected, :confirmed, :provisional] # and so does this
|
42
|
+
booking.status === [%i[rejected confirmed provisional]] # and this
|
42
43
|
|
43
44
|
Booking.where( :status_id => BookingStatus[:provisional] )
|
44
45
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.7.0
|
@@ -222,7 +222,7 @@ module PowerEnum
|
|
222
222
|
nil
|
223
223
|
when 1
|
224
224
|
arg = args.first
|
225
|
-
lookup_enum_by_type(arg) || handle_lookup_failure(arg)
|
225
|
+
Array === arg ? self[*arg] : (lookup_enum_by_type(arg) || handle_lookup_failure(arg))
|
226
226
|
else
|
227
227
|
args.map{ |item| self[item] }.uniq
|
228
228
|
end
|
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.7.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: 2022-06-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|