@@ -36,20 +36,34 @@ namespace Rice::detail {
3636 template <>
3737 class From_Ruby <RoutingNodeIndex> {
3838 public:
39+ From_Ruby () = default ;
40+
41+ explicit From_Ruby (Arg* arg) : arg_(arg) { }
42+
3943 Convertible is_convertible (VALUE value) { return Convertible::Cast; }
4044
4145 RoutingNodeIndex convert (VALUE x) {
4246 const RoutingNodeIndex index{From_Ruby<int >().convert (x)};
4347 return index;
4448 }
49+
50+ private:
51+ Arg* arg_ = nullptr ;
4552 };
4653
4754 template <>
4855 class To_Ruby <RoutingNodeIndex> {
4956 public:
57+ To_Ruby () = default ;
58+
59+ explicit To_Ruby (Arg* arg) : arg_(arg) { }
60+
5061 VALUE convert (RoutingNodeIndex const & x) {
5162 return To_Ruby<int >().convert (x.value ());
5263 }
64+
65+ private:
66+ Arg* arg_ = nullptr ;
5367 };
5468} // namespace Rice::detail
5569
@@ -62,7 +76,7 @@ void init_routing(Rice::Module& m) {
6276 rb_cRoutingSearchParameters
6377 .define_method (
6478 " first_solution_strategy=" ,
65- [](RoutingSearchParameters& self, Symbol value) {
79+ [](RoutingSearchParameters& self, Object value) {
6680 auto s = Symbol (value).str ();
6781
6882 FirstSolutionStrategy::Value v;
@@ -102,7 +116,7 @@ void init_routing(Rice::Module& m) {
102116 })
103117 .define_method (
104118 " local_search_metaheuristic=" ,
105- [](RoutingSearchParameters& self, Symbol value) {
119+ [](RoutingSearchParameters& self, Object value) {
106120 auto s = Symbol (value).str ();
107121
108122 LocalSearchMetaheuristic::Value v;
0 commit comments