Sha256: cb87f576c75d648c2af9ab224be1fe76ec270e537c25aa00c49c3d1a096aaba5

Contents?: true

Size: 702 Bytes

Versions: 3

Compression:

Stored size: 702 Bytes

Contents

require 'active_support/configurable'

module Snipp

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

  def self.config
    @config
  end

  class Configuration #:nodoc:
    include ActiveSupport::Configurable
    config_accessor :markup

    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.markup  = :microdata
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
snipp-0.0.5 lib/snipp/config.rb
snipp-0.0.4 lib/snipp/config.rb
snipp-0.0.3 lib/snipp/config.rb