Module: IsBotParser
- Defined in:
- lib/parser.rb
Constant Summary collapse
- PATTERN_LIST =
Array.new
Class Method Summary collapse
Class Method Details
.data_file ⇒ Object
9 10 11 |
# File 'lib/parser.rb', line 9 def IsBotParser.data_file $basedir + 'data' + 'data.json' end |
.parse ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/parser.rb', line 13 def IsBotParser.parse json_str = IO.read(data_file) list = JSON.parse(json_str) list.each do |item| pattern = item['pattern'].to_s PATTERN_LIST.push(pattern) unless PATTERN_LIST.include? pattern end PATTERN_LIST end |