active_enumeration 0.0.4 → 0.0.6
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/lib/active_enumeration/base.rb +6 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 118b3ee015d274db3104a8e541fe4aeab0334ccf
|
4
|
+
data.tar.gz: 9bac0647f96007ac6531a73618227c13d4d5cbe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
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.
|
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.
|
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:
|