Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modify base method name

  • Loading branch information...
commit aa35e4fe0fa7d6c19e472bc058dec8e26068d559 1 parent 011ee81
@kachick authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/integer/base/singleton_class.rb
View
12 lib/integer/base/singleton_class.rb
@@ -26,7 +26,7 @@ def parse(str, chars)
# @param [#to_int] num
# @param [Array<#to_sym>] chars
# @return [String]
- def convert_to_string(num, chars)
+ def string_for(num, chars)
case chars.length
when 1
convert_to_string_unary num, chars.first
@@ -34,6 +34,8 @@ def convert_to_string(num, chars)
convert_to_string_positional num, chars
end
end
+
+ alias_method :convert_to_string, :string_for
private
@@ -118,7 +120,7 @@ def parse_unary_abs(str, char)
end
# @return [String]
- def convert_to_string_positional(num, chars)
+ def string_positional_for(num, chars)
chars = base_chars_for chars
int = num.to_int
base = chars.length
@@ -136,9 +138,11 @@ def convert_to_string_positional(num, chars)
s.insert 0, '-' if int < 0
}
end
+
+ alias_method :convert_to_string_positional, :string_positional_for
# @return [String]
- def convert_to_string_unary(num, char)
+ def string_unary_for(num, char)
char = unary_char_for char
int = num.to_int
@@ -146,6 +150,8 @@ def convert_to_string_unary(num, char)
s.insert 0, '-' if int < 0
}
end
+
+ alias_method :convert_to_string_unary, :string_unary_for
end
Please sign in to comment.
Something went wrong with that request. Please try again.