Module: Nuggets::Integer::LengthMixin

Included in:
Integer
Defined in:
lib/nuggets/integer/length_mixin.rb

Instance Method Summary collapse

Instance Method Details

#digit_countObject

call-seq:

int.digit_count => anInteger

Returns the digit count of int. [ruby-core:22383]



43
44
45
# File 'lib/nuggets/integer/length_mixin.rb', line 43

def digit_count
  abs.length
end

#lengthObject

call-seq:

int.length => anInteger

Returns the length of int.



35
36
37
# File 'lib/nuggets/integer/length_mixin.rb', line 35

def length
  to_s.length
end