lib/phonelib/phone_analyzer_helper.rb
# Checks if passed number matches valid and possible patterns
#
# ==== Attributes
#
# * +number+ - phone number for validation
# * +p_regex+ - possible regex pattern for validation
# * +v_regex+ - valid regex pattern for validation
# * +not_valid+ - specifies that number is not valid by general desc pattern
Checks if passed number matches valid and possible patterns
Attributes


Checks if passed number matches valid and possible patterns Attributes
def number_valid_and_possible?(number, p_regex, v_regex, not_valid = false)
      possible = number_match?(number, p_regex)
      return [!not_valid && possible, possible] if p_regex == v_regex
      valid = !not_valid && possible && number_match?(number, v_regex)
      [valid && possible, possible]
    end
def number_valid_and_possible? ( number , p_regex , v_regex , not_valid = false ) possible = number_match? ( number , p_regex ) return [ ! not_valid && possible , possible ] if p_regex == v_regex valid = ! not_valid && possible && number_match? ( number , v_regex ) [ valid && possible , possible ] end
Checks if passed number matches valid and possible patterns
 Attributes
Checks if passed number matches valid and possible patterns Attributes
number
<not_specific>
p_regex
<not_specific>
v_regex
<not_specific>
not_valid
<not_specific>