lib/draftsman/config.rb in draftsman-0.4.0 vs lib/draftsman/config.rb in draftsman-0.5.0

- old
+ new

@@ -5,9 +5,19 @@ 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