module Timewizard::Utils::Wizardry

Contains utility functions in a cleverly named module. @author Richard Harrah @since 0.2.4

Constants

VERSION_REGEX

Public Class Methods

only_version(stringy) click to toggle source

Returns a substring of the passed-in value that matches {Timewizard::Utils::Wizardry::VERSION_REGEX the version regex}. @param [String] stringy string from which to extract version string @return [String] substring that matches {Timewizard::Utils::Wizardry::VERSION_REGEX the version regex} @raise [ArgumentError] if stringy is null

# File lib/timewizard/utils/wizardry.rb, line 16
def self.only_version(stringy)
  if stringy.nil?
    raise ArgumentError, "stringy cannot be null"
  end
  VERSION_REGEX.match(stringy.to_s).to_s
end