Is there an equivalent of the String chars method for fixnum? Am trying to separate an integer value by value into an array e.g. 1234 -> [1, 2, 3, 4] to then perform operations on the individual values.
Or is it better to convert into a string first, perform an operation (example x 2) and then join as integers? Like below:
def method_name num
num.to_s.chars.map{|x| x.to_i*2}.join.to_i
end