Class: Stockade::Lexemes::Phone

Inherits:
Base
  • Object
show all
Defined in:
lib/stockade/lexemes/phone.rb

Overview

Phone lexeme

Constant Summary collapse

MASKS =
File.readlines('data/phones.txt').freeze

Instance Attribute Summary

Attributes inherited from Base

#raw_value, #start_pos

Class Method Summary collapse

Methods inherited from Base

#==, #end_pos, #initialize, #mask, #range, #token, #type, types, #valid?, #value

Constructor Details

This class inherits a constructor from Stockade::Lexemes::Base

Class Method Details

.regexObject



10
11
12
13
14
15
16
17
# File 'lib/stockade/lexemes/phone.rb', line 10

def regex
  /
  #{MASKS
    .map { |mask| to_re(mask) }
    .join(" |\n")
  }
  /x
end