Sha256: 1a10711c94d12e02413d3d848bb78efcbb0910263d0d9bbc41bfd3f78fdeff1d

Contents?: true

Size: 486 Bytes

Versions: 1

Compression:

Stored size: 486 Bytes

Contents

require 'singleton'

module Draftsman
  class Config
    include Singleton
    attr_accessor :serializer, :timestamp_field

    def initialize
      @timestamp_field = :created_at
      @mutex = Mutex.new
      @serializer      = Draftsman::Serializers::Yaml
    end

    # Indicates whether Draftsman is on or off. Default: true.
    def enabled
      @mutex.synchronize { !!@enabled }
    end

    def enabled=(enable)
      @mutex.synchronize { @enabled = enable }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
draftsman-0.5.0 lib/draftsman/config.rb