Module: Integer::Base::IntegerPrepender

Defined in:
lib/integer/base/refinementable.rb

Instance Method Summary collapse

Instance Method Details

#to_s(base = 10) ⇒ String

Parameters:

  • base (Fixnum) (defaults to: 10)

    Delegate to standard to_s

Returns:

  • (String)


22
23
24
25
26
27
28
29
# File 'lib/integer/base/refinementable.rb', line 22

def to_s(base=10)
  case base
  when Enumerable
    ::Integer::Base.string_for(self, base)
  else
    super(base)
  end
end