code 2

code(script = Proc.new)
Instance Public methods

def code(script = Proc.new)

if script.kind_of?(String)
  cmd = proc{|*args| ScopeArgs.new(@fullname,*args).instance_eval(script)}
elsif script.kind_of?(Proc)
  cmd = proc{|*args| ScopeArgs.new(@fullname,*args).instance_eval(&script)}
else
  fail ArgumentError, "String or Proc is expected"
end
TkNamespace::NsCode.new(tk_call_without_enc('namespace', 'code',
                                            _get_eval_string(cmd, false)))

end

doc_ruby_on_rails
2015-06-06 20:35:26
Comments
Leave a Comment

Please login to continue.