lib/roda/plugins/mail_processor.rb
def rcpt(*addresses, &block)
          opts[:mail_processor_string_routes] ||= {}
          opts[:mail_processor_regexp_routes] ||= {}
          string_meth = nil
          regexp_meth = nil
          addresses.each do |address|
            case address
            when String
              unless string_meth
                string_meth = define_roda_method("mail_processor_string_route_#{address}", 1, &convert_route_block(block))
              end
              opts[:mail_processor_string_routes][address] = string_meth 
            when Regexp
              unless regexp_meth
                regexp_meth = define_roda_method("mail_processor_regexp_route_#{address}", :any, &convert_route_block(block))
              end
              opts[:mail_processor_regexp_routes][address] = regexp_meth
            else
              raise RodaError, "invalid address format passed to rcpt, should be Array or String"
            end
          end
          nil
        end
# Setup a routing tree for the given recipient addresses, which can be strings or regexps.
# Any messages matching the given recipient address will use these routing trees instead
# of the normal routing tree.
Setup a routing tree for the given recipient addresses, which can be strings or regexps.
Any messages matching the given recipient address will use these routing trees instead
of the normal routing tree.
Setup a routing tree for the given recipient addresses which can be strings or regexps . Any messages matching the given recipient address will use these routing trees instead of the normal routing tree .
def rcpt(*addresses, &block)
          opts[:mail_processor_string_routes] ||= {}
          opts[:mail_processor_regexp_routes] ||= {}
          string_meth = nil
          regexp_meth = nil
          addresses.each do |address|
            case address
            when String
              unless string_meth
                string_meth = define_roda_method("mail_processor_string_route_#{address}", 1, &convert_route_block(block))
              end
              opts[:mail_processor_string_routes][address] = string_meth 
            when Regexp
              unless regexp_meth
                regexp_meth = define_roda_method("mail_processor_regexp_route_#{address}", :any, &convert_route_block(block))
              end
              opts[:mail_processor_regexp_routes][address] = regexp_meth
            else
              raise RodaError, "invalid address format passed to rcpt, should be Array or String"
            end
          end
          nil
        end
def rcpt ( * addresses , & block ) opts [ :mail_processor_string_routes ] ||= { } opts [ :mail_processor_regexp_routes ] ||= { } string_meth = nil regexp_meth = nil addresses . each do | address | case address when String unless string_meth string_meth = define_roda_method ( "mail_processor_string_route_#{address}" , 1 , & convert_route_block ( block ) ) end opts [ :mail_processor_string_routes ] [ address ] = string_meth when Regexp unless regexp_meth regexp_meth = define_roda_method ( "mail_processor_regexp_route_#{address}" , :any , & convert_route_block ( block ) ) end opts [ :mail_processor_regexp_routes ] [ address ] = regexp_meth else raise RodaError , "invalid address format passed to rcpt, should be Array or String" end end nil end
Setup a routing tree for the given recipient addresses, which can be strings or regexps.
Setup a routing tree for the given recipient addresses which can be strings or regexps .
addresses
block