ViewComposer 0.1.0 → 0.1.1
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/ViewComposer/base_composer.rb +6 -1
- data/lib/ViewComposer/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: e01710912069f547c2f251e819955b4dfdf76c2c
|
4
|
+
data.tar.gz: 15315b3fcdc08e1cd8ef1f43afd23f35f9adce13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de0ded3689cf1873e8c08dff447c262f94645720cf7bae67d1090a920d1be3445eec8259cda3f22f0e2e5e49d9352648e848bc25b6171b77d4f8392c6c748771
|
7
|
+
data.tar.gz: 2fbf89468409977c0f009eb7c0e3fa3719c04a23d867dd568bca11ca613e0674102eb1bcbac02fbc01e26e58addbf7288945431a345d2f074a2386f886b1692d
|
@@ -8,7 +8,10 @@ class BaseComposer
|
|
8
8
|
def initialize(model:, composable_objects: [] )
|
9
9
|
@model = model
|
10
10
|
@json_hash = {}
|
11
|
+
|
12
|
+
@parent_methods = self.class.superclass.instance_methods(false)
|
11
13
|
@composer_methods = self.class.instance_methods(false)
|
14
|
+
@dont_redefine = @parent_methods + @composer_methods
|
12
15
|
@_attrs = self.class._attributes
|
13
16
|
set_attributes
|
14
17
|
setup_comp_objs(composable_objects)
|
@@ -42,7 +45,8 @@ private
|
|
42
45
|
end
|
43
46
|
|
44
47
|
def set_attributes
|
45
|
-
defineable_methods = @_attrs - @
|
48
|
+
defineable_methods = @_attrs - @dont_redefine
|
49
|
+
#puts "#{self}: #{defineable_methods}"
|
46
50
|
define_methods(defineable_methods, @model)
|
47
51
|
end
|
48
52
|
|
@@ -57,6 +61,7 @@ private
|
|
57
61
|
def define_methods(method_names, method_owner)
|
58
62
|
method_names.each do |attr|
|
59
63
|
self.class.send(:define_method, attr) do
|
64
|
+
#puts method_owner.send(attr)
|
60
65
|
method_owner.send(attr)
|
61
66
|
end
|
62
67
|
end
|
data/lib/ViewComposer/version.rb
CHANGED