activeoopish 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activeoopish/inheritance.rb +5 -0
- data/lib/activeoopish/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d36e3d551e946a96d3708403f9ebdd839f59fda2
|
4
|
+
data.tar.gz: 813eba314006c6bf214ae6580158374a73cf45e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fe3dba18ed69fb1e954d9c779afdfa488fc043da387cff374e07e4d95886c4dea82a05cf3ec0b353bbb014e830d792901aaa7a295d6528149cf77f277f4d518
|
7
|
+
data.tar.gz: 545827dc6bdcebe9807496430671b084f73bc2b94699db3266e240c8e467c1dc65c2ca2d48440c31ad466449e0719c629dc1e102be6eeffe7f0de2aa22699d71
|
@@ -4,6 +4,10 @@ module ActiveOopish
|
|
4
4
|
module Inheritance
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
|
+
included do
|
8
|
+
instance_variable_set('@instantiation_rules', [])
|
9
|
+
end
|
10
|
+
|
7
11
|
module ClassMethods
|
8
12
|
# Public:
|
9
13
|
#
|
@@ -11,6 +15,7 @@ module ActiveOopish
|
|
11
15
|
# condition - A Hash.
|
12
16
|
#
|
13
17
|
def instantiate_as(class_name, options = {})
|
18
|
+
@instantiation_rules ||= []
|
14
19
|
@instantiation_rules << { class_name: class_name, condition: options.stringify_keys }
|
15
20
|
end
|
16
21
|
|
data/lib/activeoopish/version.rb
CHANGED