module Boty class ActionDescription attr_reader :command, :description attr_writer :regex def initialize(command, description: nil, regex: nil) if description.nil? @description = command else @command = command @description = description end @regex = regex end def command return @command if @command return unless @regex match = /\?(i?)-(mx|mix):(.*)\)/.match @regex.to_s @command = "/#{match[3]}/#{match[1]}" end end end