Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
for YARD
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed May 7, 2012
1 parent 16de510 commit 870df30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/integer/base/eigen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ def convert_to_string(num, chars)
return chars.first.to_s if int == 0

''.tap {|s|
n = int
n = int.abs

until (n, excess = n.divmod base; n == 0 && excess == 0)
s << chars[excess].to_s
end

s.reverse!
s.insert 0, '-' if int < 0
}
end

Expand Down
13 changes: 9 additions & 4 deletions lib/integer/base/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ class String

remove_method :to_i

# @param [Fixnum] base
# @param [Array<String>] base
# @overload to_i(base_number)
# @param [Fixnum] base_number Delegate to standard to_i
# @overload to_i(positional_chars)
# @param [Array<#to_sym>] positional_chars
# @return [Integer]
def to_i(base=10)
case base
Expand Down Expand Up @@ -34,8 +36,11 @@ def Integer(obj)
end

class Integer
# @param [Fixnum] base
# @param [Array<String>] base

# @overload to_s(base_number)
# @param [Fixnum] base_number Delegate to standard to_s
# @overload to_s(positional_chars)
# @param [Array<#to_sym>] positional_chars
# @return [String]
def to_s(base=10)
case base
Expand Down

0 comments on commit 870df30

Please sign in to comment.