lib/baseconv.rb
# Representation to Value
# 
# Compute the number given by digits in base b.
Representation to Value
Compute the number given by digits in base b.
Representation to Value Compute the number given by digits in base b .
def value_of(digits, in_base:)
    number = 0
    digits.to_s.chars.each do |digit|
      number = in_base * number + CHARS.index(digit)
    end
    number
  end
def value_of ( digits , in_base : ) number = 0 digits . to_s . chars . each do | digit | number = in_base * number + CHARS . index ( digit ) end number end
Representation to Value
Compute the number given by digits in base b.
Representation to Value Compute the number given by digits in base b .
digits
in_base