Sha256: 0ed143868d465f7fa89152ce24780307279efee553727211727ed30fc209d386

Contents?: true

Size: 1002 Bytes

Versions: 8

Compression:

Stored size: 1002 Bytes

Contents

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

  def self.config
    @config
  end

  # Configuration class
  class Configuration
    include ActiveSupport::Configurable

    config_accessor :max_reply_depth,
                    :tolerance_time,
                    :default_state,
                    :default_owner_state,
                    :empty_inputs,
                    :default_title,
                    :template_engine,
                    :empty_trap_protection,
                    :tolerance_time_protection
  end

  configure do |config|
    config.max_reply_depth     = 3
    config.tolerance_time      = 5
    config.default_state       = :draft
    config.default_owner_state = :published
    config.empty_inputs        = [:message]
    config.default_title       = 'Undefined title'
    config.template_engine     = :haml

    config.empty_trap_protection     = true
    config.tolerance_time_protection = true
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
the_comments_ruby-2.3.4 lib/the_comments/config.rb
the_comments_ruby-2.3.3 lib/the_comments/config.rb
the_comments-2.3.1 lib/the_comments/config.rb
the_comments-2.2.1 lib/the_comments/config.rb
the_comments-2.2.0 lib/the_comments/config.rb
the_comments-2.1.0 lib/the_comments/config.rb
the_comments-2.0.1 lib/the_comments/config.rb
the_comments-2.0.0 lib/the_comments/config.rb