power_enum 3.6.0 → 3.7.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
  SHA256:
3
- metadata.gz: '096a1a60d97b933ef84c3911621c9f277a03c34ede014c7177f2b2a69c8d91c2'
4
- data.tar.gz: f448294f91b76d19a31379c517787eadae5616e85cefe90072cfb5b25c648ab4
3
+ metadata.gz: afdfec8c704c968a3871c9444428cb385fcc3075bb56875a4018e4cf0f9ba5c0
4
+ data.tar.gz: 640c7bde6091cbe26b8263a000cb922c0df3c2c6e113c17d0c7846305873ee67
5
5
  SHA512:
6
- metadata.gz: e68bc90dfa496b02d65146aeca6d6aec40998c425d7fd6bf11dd746c141160e66144cb8b4ca64c7dc6b5bae2f64b77811138cc077f6b13e5ad449aea9e523b1a
7
- data.tar.gz: 450e41935d70e667db676ce92c2a685d79e152c06826a6253728003b72e58aa6ad69518b8be3d7893073a797791a0ddae425c9f317a290515371b06c3bd74765
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( :status => BookingStatus[:provisional] )
32
+ booking = Booking.new( status: BookingStatus[:provisional] )
33
33
  # This also works
34
- booking = Booking.new( :status => :provisional )
34
+ booking = Booking.new( status: :provisional )
35
35
  # Set the booking status to 'confirmed'
36
36
  booking.status = :confirmed
37
- booking = Booking.create( :status => :rejected )
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.6.0
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.6.0
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: 2021-12-08 00:00:00.000000000 Z
14
+ date: 2022-06-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler