ext/field_test/ext.cpp in field_test-0.5.1 vs ext/field_test/ext.cpp in field_test-0.5.2

- old
+ new

@@ -1,12 +1,16 @@ #include <rice/rice.hpp> -#include "bayesian_ab.hpp" +#include <rice/stl.hpp> +#include "bayestest.hpp" + +using bayestest::BinaryTest; + extern "C" void Init_ext() { auto rb_mFieldTest = Rice::define_module("FieldTest"); - Rice::define_class_under(rb_mFieldTest, "Calculations") - .define_singleton_function("prob_b_beats_a", &bayesian_ab::prob_b_beats_a) - .define_singleton_function("prob_c_beats_a_and_b", &bayesian_ab::prob_c_beats_a_and_b) - .define_singleton_function("prob_d_beats_a_and_b_and_c", &bayesian_ab::prob_d_beats_a_and_b_and_c); + Rice::define_class_under<BinaryTest>(rb_mFieldTest, "BinaryTest") + .define_constructor(Rice::Constructor<BinaryTest>()) + .define_method("add", &BinaryTest::add) + .define_method("probabilities", &BinaryTest::probabilities); }