Sha256: 0ea2f0e377107a67bfdf6f03198274c4fad5b7f37a1419693abd8d75efc35f93

Contents?: true

Size: 517 Bytes

Versions: 2

Compression:

Stored size: 517 Bytes

Contents

class Tarquinn::Builder
  def add_redirection_config(redirection, *methods, block)
    config_for(redirection).add_redirection_rules(*methods, &block)
  end

  def add_skip_config(redirection, *methods, block)
    config_for(redirection).add_skip_rules(*methods, &block)
  end

  def build(controller)
    Tarquinn::Engine.new(configs, controller)
  end

  private

  def config_for(redirection)
    configs[redirection.to_sym] ||= Tarquinn::Config.new(redirection)
  end

  def configs
    @configs ||= {}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tarquinn-0.0.2 lib/tarquinn/builder.rb
tarquinn-0.0.1 lib/tarquinn/builder.rb