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_number (Fixnum)

    Delegate to standard to_s

  • positional_chars (Array<Symbol, String, #to_sym>)

Returns:

  • (String)

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

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