active_enumeration 0.0.4 → 0.0.6

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: 223d109ab6d201e3f8584ebc9fe3ba20402a4e4d
4
- data.tar.gz: fa0283d584c8b94ef1c6cd490ad6c50d4920e5d8
3
+ metadata.gz: 118b3ee015d274db3104a8e541fe4aeab0334ccf
4
+ data.tar.gz: 9bac0647f96007ac6531a73618227c13d4d5cbe8
5
5
  SHA512:
6
- metadata.gz: 1f4116d54cc911e9f352079440806058a4404ad8639cf93de1a10f9fb54d0083e2ed96e80d5396a17e79815d3184bedb5db9a0c0dcf37f505d64054e04b49d21
7
- data.tar.gz: 9c297672df23f9394cea61922e633e06088201438ffcf59ee0383afdeaefe3d47164eeec97c6982ae018e46e9e82f329f8910c941fed45e25dec5948bb666a36
6
+ metadata.gz: 1cbe1fd8bebee467bc85497f0e8089b5f22b7c22c93d99f7676b7642493bc8ce850de2091a8cb70ae0364091b3a7dddb340cdd733faad6b0fccc523d31fdb262
7
+ data.tar.gz: 95bb505995e2bec2fb50ffa0047d4ec1928e15dd99745e8f18274caee0cea475e58f499556f73b566d75876d26d3d0cf26d525b84ebad90c8f4836adb81693d8
@@ -12,6 +12,12 @@ module ActiveEnumeration
12
12
  @instances[id]
13
13
  end
14
14
 
15
+ def self.where(filters)
16
+ self.all.select do |enum|
17
+ filters.keys.all? { |k| enum.send(k) == filters[k] }
18
+ end
19
+ end
20
+
15
21
  def self.all
16
22
  @active_enumeration_values.keys.map { |id| self.find(id) }
17
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_enumeration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Lin
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.1
19
+ version: 2.3.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.1
26
+ version: 2.3.4
27
27
  description: A simpler way to create more complex Ruby enumerations, with ActiveRecord
28
28
  like syntax and associations.
29
29
  email: peter@peterl.in
@@ -58,3 +58,4 @@ signing_key:
58
58
  specification_version: 4
59
59
  summary: ActiveEnumeration
60
60
  test_files: []
61
+ has_rdoc: