Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refact .#convert_to_string

  • Loading branch information...
commit 7ad6aac24bff772afc86eb4681f99302a318c1a0 1 parent a4be51c
@kachick authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/integer/base/eigen.rb
View
8 lib/integer/base/eigen.rb
@@ -19,13 +19,13 @@ def parse(str, chars)
(sign == :-) ? -abs : abs
end
- # @param [Integer] int
+ # @param [#to_int] num
# @param [Array<#to_sym>] chars
# @return [String]
- def convert_to_string(int, chars)
- raise TypeError unless int.kind_of? Integer
+ def convert_to_string(num, chars)
chars = base_chars_for chars
- base = chars.length
+ int = num.to_int
+ base = chars.length
return chars.first.to_s if int == 0
Please sign in to comment.
Something went wrong with that request. Please try again.