lib/phony/country.rb
def plausible? rest, hints = {}
      local, _, ndc, *rest = split_ndc rest

      # Element based checking.
      #
      # Note: ndc == false means the country has none.
      #
      return false if ndc.nil?
      return false if ndc && ndc.empty?
      return false if @invalid_ndcs.include? ndc # TODO Refactor.

      # # A valid range for the rest is 0 or 3+ total digits.
      # #
      # return false if (1..2) === rest_size

      # National destination code plausible?
      #
      ndc_needed = hints[:ndc]
      return false if ndc_needed && !(ndc_needed === ndc)

      # Local code specific checks.
      #
      return local.plausible? rest, hints
    end
# Tests for plausibility of this national number.
#
Tests for plausibility of this national number.
Tests for plausibility of this national number .
def plausible? rest, hints = {}
      local, _, ndc, *rest = split_ndc rest
       Note: ndc == false means the country has none.
      return false if ndc.nil?
      return false if ndc && ndc.empty?
      return false if @invalid_ndcs.include? ndc  TODO Refactor.
        A valid range for the rest is 0 or 3+ total digits.
       return false if (1..2) === rest_size
       National destination code plausible?
      ndc_needed = hints[:ndc]
      return false if ndc_needed && !(ndc_needed === ndc)
       Local code specific checks.
      return local.plausible? rest, hints
    end
def plausible? rest , hints = { } local , _ , ndc , * rest = split_ndc rest return false if ndc . nil? return false if ndc && ndc . empty? return false if @invalid_ndcs . include? ndc ndc_needed = hints [ :ndc ] return false if ndc_needed && ! ( ndc_needed === ndc ) return local . plausible? rest , hints end
Tests for plausibility of this national number.
Tests for plausibility of this national number .
# Element based checking. # # Note: ndc == false means the country has none. # # TODO Refactor. # # A valid range for the rest is 0 or 3+ total digits. # # # return false if (1..2) === rest_size # National destination code plausible? # # Local code specific checks. #
rest
hints