Module: FBParsers
- Defined in:
- lib/parser_collection.rb
Constant Summary collapse
- @@basic_sell_parser =
lambda do || price = nil title = nil = nil price_regex = /NT\$([\d,\.]+)/ lines = .split("\n") if lines.length > 3 unless price_regex.match(lines[1]).nil? price = price_regex.match(lines[1])[1] end end if not price.nil? {"price" => price.gsub(",","").to_i , "title" => lines[0] ,"message" => lines[3..-1].join("\n")} else raise ArgumentError, "message parse fail" end end
- @@tools =
{ "1730742887066429" => @@basic_sell_parser, "144498012423141" => @@basic_sell_parser, "107793636088378" => @@basic_sell_parser, "191505604299442" => @@basic_sell_parser, "815837461828111" => @@basic_sell_parser, "952367224814302" => @@basic_sell_parser, "373766972786317" => @@basic_sell_parser, "1049467665068019" => @@basic_sell_parser, }
Class Method Summary collapse
Class Method Details
.message_parser(gid) ⇒ Object
34 35 36 |
# File 'lib/parser_collection.rb', line 34 def self. (gid) @@tools[gid] end |
.message_parser_all ⇒ Object
37 38 39 |
# File 'lib/parser_collection.rb', line 37 def self. @@tools end |