Skip to content

Commit

Permalink
... tiny cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
funny-falcon committed Jul 26, 2012
1 parent 4d4fa6d commit 7ea580f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/funfig/group.rb
Expand Up @@ -184,7 +184,7 @@ def self.group(name, &block)
end
klass.instance_variable_set(:@parent, self)

define_method(name) do |*args, &block|
define_method(name) do
instance_variable_get(vname) ||
instance_variable_set(vname, self.class._params[name].new(self))
end
Expand All @@ -197,7 +197,7 @@ def self.group(name, &block)
_._cache_clear!
remove_instance_variable(vname) if instance_variable_defined?(vname)
end
klass.class_exec &block
klass.class_exec(&block)
klass
end

Expand All @@ -223,7 +223,7 @@ def self.param(name, value = NOT_SET, &block)
}
end

define_method(name) do |*args|
define_method(name) do
if instance_variable_defined?(vname)
instance_variable_get(vname)
else
Expand Down Expand Up @@ -287,6 +287,7 @@ def self.reference(name, refered, &block)
# other_conf = config.clone do
# param :other_value do other_default end
# end
#
def self.clone(&block)
new = super
new.class_exec &block if block_given?
Expand Down

0 comments on commit 7ea580f

Please sign in to comment.