Exemple #1
0
        public static object Evaluate(RubyScope /*!*/ scope, object self, [NotNull] MutableString /*!*/ code,
                                      [Optional, NotNull] MutableString file, [DefaultParameterValue(1)] int line)
        {
            RubyClass singleton = scope.RubyContext.GetOrCreateSingletonClass(self);

            return(RubyUtils.Evaluate(code, scope, self, singleton, file, line));
        }
Exemple #2
0
        public static object Evaluate(RubyScope /*!*/ scope, BlockParam block, RubyModule /*!*/ self, [NotNull] MutableString /*!*/ code,
                                      [Optional, NotNull] MutableString file, [DefaultParameterValue(1)] int line)
        {
            if (block != null)
            {
                throw RubyExceptions.CreateArgumentError("wrong number of arguments");
            }

            return(RubyUtils.Evaluate(code, scope, self, self, file, line));
        }
 public override object Execute(string code)
 {
     return(RubyUtils.Evaluate(MutableString.Create(code), _topLevelBinding.LocalScope, _topLevelBinding.LocalScope.SelfObject, null, null, 0));
 }