static public Method

Internal.run_initializer_block(instance, block)

If a block was passed to the constructor, then run that now. Either run the context of the new instance if no args were passed to the block. Or otherwise, run the block in the context of the arg.

Source Code

# File qt/qtruby4.rb, line 2207
def Internal.run_initializer_block(instance, block)
        if block.arity == -1
                instance.instance_eval(&block)
        elsif block.arity == 1
                block.call(instance)
        else
                raise ArgumentError, "Wrong number of arguments to block(#{block.arity} for 1)"
        end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.