module Hammerhead::Utils

Contains utility-type methods available for use throughout the tool.

Public Instance Methods

digits?(input) click to toggle source

Returns true if the specified input consists of digits

digits? '1234' => true
digits? 'abcd' => false

Uses a regular expression to determine if all the specified characters are numeric.

# File lib/hammerhead/utils.rb, line 18
def digits? input
  input.match?(/\A\d+\Z/)
end