Sha256: 7c7e5a3a59df3710cedc26896086987b799012965431aab8c2b8763623e037d3

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

require 'active_support/configurable'

module Raccoon

  def self.configure(&block)
    yield @config ||= Raccoon::Configuration.new
  end

  def self.config
    @config
  end

  class Configuration #:nodoc:
    include ActiveSupport::Configurable
    config_accessor :application, :render_views

    def param_name
      config.param_name.respond_to?(:call) ? config.param_name.call : config.param_name
    end

    # define param_name writer (copied from AS::Configurable)
    writer, line = 'def param_name=(value); config.param_name = value; end', __LINE__
    singleton_class.class_eval writer, __FILE__, line
    class_eval writer, __FILE__, line
  end

  configure do |config|
    config.render_views = true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
raccoon-0.0.1 lib/raccoon/config.rb