lib/ruboty/handlers/fop.rb in ruboty-fop-0.0.1 vs lib/ruboty/handlers/fop.rb in ruboty-fop-0.0.2

- old
+ new

@@ -12,13 +12,10 @@ 'NRT' => 'TYO', 'ITM' => 'OSA', 'KIX' => 'OSA', } - on(/imascg(?:\s+?(?<mode>.+?))?(?:\s+?me)?\s+(?<query>.+)$/, name: 'imascg', description: 'find imascg cards') - on(/imascg flush cache/, name: 'imascg_flush', description: 'flush imascg query cache') - on(/fop\s+help$/, name: 'fop_help', description: 'JAL calculator help') on(/fop\s+list(?:(?:\s+airports?)?(?:\s+(?<filter>.+))?)?$/, name: 'fop_airports', description: 'JAL calculator: List airports') on(/fop\s+(?:I\s+)?prefer(?<options>(?:\s+-(?:class|(?:dom|intl)-fare|card|status)\s+[^\s]+)*)\s*$/i, name: 'fop_prefer', description: 'JAL calculator: Set preference') on(/fop\s+(?<from>[a-zA-Z0-9]+?)[\/-](?<to>[a-zA-Z0-9]+?)\s*(?<options>(?:\s+-(?:class|fare|card|status)\s+[^\s]+)*)\s*$/, name: 'fop_calc', description: 'JAL calculator') @@ -153,10 +150,10 @@ if options.empty? message.reply "Your preference is:\n#{preference.inspect}" else options.each do |k, v| case k - when :class; find_class(v) + when :class; find_dom_class(v) when :'dom-fare'; find_dom_fare(v) when :'intl-fare'; find_intl_fare(v) when :card; find_card(v) when :status; find_status(v) end