class Roda::RodaPlugins::HostRouting::DSL

def default(hostname, &block)

given to this method is used.
provided to +to+. If the block returns nil/false, the hostname
called with the host if there is no match for one of the hostnames
Register the default hostname. If a block is provided, it is
def default(hostname, &block)
  @default_host = hostname
  @default_block = block
end

def initialize

def initialize
  @hosts = []
  @host_hash = {}
end

def process(&block)

Run the DSL for the given block.
def process(&block)
  instance_exec(self, &block)
  if !@default_host
    raise RodaError, "must call default method inside host_routing plugin block to set default host"
  end
  @hosts.concat(@host_hash.values)
  @hosts << @default_host
  @hosts.uniq!
  [@hosts.freeze, @host_hash.freeze, @default_block, @default_host].freeze
end

def register(*hosts)

a value that doesn't match a host given to +to+ or +default+.
calling register with a block, where the block can return
Register hosts that can be returned. This is only needed if
def register(*hosts)
  @hosts = hosts
end

def to(host, *hostnames)

Treat all given hostnames as routing to the give host.
def to(host, *hostnames)
  hostnames.each do |hostname|
    @host_hash[hostname] = host
  end
end