smart_init 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smart_init/main.rb +3 -3
- data/lib/smart_init/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: 6056d4cf08e55061d4b7cb406fa3d61107d7703e
|
4
|
+
data.tar.gz: ff3853b9c773b1115503641aabd4bd93d46f3382
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fda5e0d95ed0b7282a4ba94ebbcc32ecf61c09e72949424372cd4a355ea92b32da05a27fb5d2a17c272bd9e63240c793e5f5031f97a23e872728fe043c974c73
|
7
|
+
data.tar.gz: ce961616f650be88b47a8e4b0fcc074e91e17c469e8a3722ae265fae8929642e30096e9af21d0cecccd0d0f94a1c710fd6333b9ed0fba369aa5a7b070e660b36
|
data/lib/smart_init/main.rb
CHANGED
@@ -39,14 +39,14 @@ module SmartInit
|
|
39
39
|
|
40
40
|
class_eval <<-METHOD
|
41
41
|
def initialize(#{(@@_required_attrs + @@_default_value_attrs.keys).compact.map { |a| @@_default_value_attrs[a] ? "#{a.to_s}: '#{@@_default_value_attrs.fetch(a)}'" : "#{a}:" }.join(', ')})
|
42
|
-
@@_required_attrs
|
42
|
+
@@_required_attrs.each do |attribute|
|
43
43
|
instance_variable_set(
|
44
44
|
"@"+ attribute.to_s,
|
45
45
|
eval(attribute.to_s)
|
46
46
|
)
|
47
47
|
end
|
48
48
|
|
49
|
-
@@_default_value_attrs
|
49
|
+
@@_default_value_attrs.keys.each do |attribute|
|
50
50
|
instance_variable_set(
|
51
51
|
"@"+ attribute.to_s,
|
52
52
|
eval(attribute.to_s)
|
@@ -58,7 +58,7 @@ module SmartInit
|
|
58
58
|
instance_eval do
|
59
59
|
private
|
60
60
|
|
61
|
-
attr_reader *(required_attrs + default_value_attrs
|
61
|
+
attr_reader *(required_attrs + default_value_attrs.keys)
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
data/lib/smart_init/version.rb
CHANGED