CDT::ListOperation.get_by_rank, wrong number of arguments (given 3, expected 2)


Hi, I am trying to get minimum and maximum value of some list, and I was looking for example of timeseries, and I am trying to use something like this:

op_size = [CDT::ListOperation.get_by_rank('data',-1,7)]

but got ArgumentError (wrong number of arguments (given 3, expected 2))

In documentation it states that 3 parameter is return type, but I got error. What am I doing wrong? Thank you


The return_type is a keyword argument, so you need to call the method like this:

CDT::ListOperation.get_by_rank('data', -1, return_type: CDT::ListReturnType::VALUE)

Or using this alternative syntax:

CDT::ListOperation.get_by_rank('data', -1).and_return(CDT::ListReturnType::VALUE)

Ah, I understand, thank you, will try