81 From_Ruby() =
default;
83 explicit From_Ruby(Arg* arg) : arg_(arg) {}
84 Rice::detail::Convertible is_convertible(VALUE value)
86 ruby_value_type vt = rb_type(value);
87 return (vt == RUBY_T_FLOAT or vt == RUBY_T_FIXNUM or vt == RUBY_T_BIGNUM)
88 ? Rice::detail::Convertible::Exact
89 : Rice::detail::Convertible::None;
93 if(value == Qnil && this->arg_ && this->arg_->hasDefaultValue())
99 switch(rb_type(value))
107 auto const& [success, VAL, errorMessage]
108 = knowCore::BigNumber::fromString(From_Ruby<QString>().convert(rb_big2str(value, 10)));
115 throw std::runtime_error(errorMessage.value().get_message().toStdString());
120 throw Exception(rb_eTypeError,
"wrong argument type %s (expected % s)",
121 detail::protect(rb_obj_classname, value),
"number");
176 class From_Ruby<knowCore::Value>
179 From_Ruby() =
default;
181 explicit From_Ruby(Arg* arg) : arg_(arg) {}
182 Rice::detail::Convertible is_convertible(VALUE) {
return Rice::detail::Convertible::Exact; }
186 if(value == Qnil && this->arg_ && this->arg_->hasDefaultValue())
192 auto const& [success, VAL, error] = knowRuby::ConverterManager::toKnowCoreValue(value);
199 throw std::runtime_error(error.value().get_message().toStdString());