funfig 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/funfig/group.rb +5 -4
- data/lib/funfig/version.rb +1 -1
- metadata +1 -1
data/lib/funfig/group.rb
CHANGED
@@ -177,14 +177,14 @@ module Funfig
|
|
177
177
|
klass = _prev.is_a?(Class) && Group >= _prev ? _prev : Class.new(Group)
|
178
178
|
_params[name] = klass
|
179
179
|
path = _sub_name(name)
|
180
|
-
const_set name.
|
180
|
+
const_set name.to_s.gsub(/(^|_)([a-z])/){ $2.upcase }, klass
|
181
181
|
|
182
182
|
klass.send(:define_singleton_method, :_path) do
|
183
183
|
path
|
184
184
|
end
|
185
185
|
klass.instance_variable_set(:@parent, self)
|
186
186
|
|
187
|
-
define_method(name) do
|
187
|
+
define_method(name) do
|
188
188
|
instance_variable_get(vname) ||
|
189
189
|
instance_variable_set(vname, self.class._params[name].new(self))
|
190
190
|
end
|
@@ -197,7 +197,7 @@ module Funfig
|
|
197
197
|
_._cache_clear!
|
198
198
|
remove_instance_variable(vname) if instance_variable_defined?(vname)
|
199
199
|
end
|
200
|
-
klass.class_exec
|
200
|
+
klass.class_exec(&block)
|
201
201
|
klass
|
202
202
|
end
|
203
203
|
|
@@ -223,7 +223,7 @@ module Funfig
|
|
223
223
|
}
|
224
224
|
end
|
225
225
|
|
226
|
-
define_method(name) do
|
226
|
+
define_method(name) do
|
227
227
|
if instance_variable_defined?(vname)
|
228
228
|
instance_variable_get(vname)
|
229
229
|
else
|
@@ -287,6 +287,7 @@ module Funfig
|
|
287
287
|
# other_conf = config.clone do
|
288
288
|
# param :other_value do other_default end
|
289
289
|
# end
|
290
|
+
#
|
290
291
|
def self.clone(&block)
|
291
292
|
new = super
|
292
293
|
new.class_exec &block if block_given?
|
data/lib/funfig/version.rb
CHANGED