Class: Draftsman::Config
- Inherits:
-
Object
- Object
- Draftsman::Config
- Includes:
- Singleton
- Defined in:
- lib/draftsman/config.rb
Instance Attribute Summary collapse
-
#serializer ⇒ Object
Returns the value of attribute serializer.
-
#stash_drafted_changes ⇒ Object
(also: #stash_drafted_changes?)
Returns the value of attribute stash_drafted_changes.
-
#timestamp_field ⇒ Object
Returns the value of attribute timestamp_field.
-
#whodunnit_field ⇒ Object
Returns the value of attribute whodunnit_field.
Instance Method Summary collapse
-
#enabled ⇒ Object
Indicates whether Draftsman is on or off.
- #enabled=(enable) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 15 16 |
# File 'lib/draftsman/config.rb', line 9 def initialize @timestamp_field = :created_at @mutex = Mutex.new @serializer = Draftsman::Serializers::Yaml @enabled = true @whodunnit_field = :whodunnit @stash_drafted_changes = true end |
Instance Attribute Details
#serializer ⇒ Object
Returns the value of attribute serializer.
6 7 8 |
# File 'lib/draftsman/config.rb', line 6 def serializer @serializer end |
#stash_drafted_changes ⇒ Object Also known as: stash_drafted_changes?
Returns the value of attribute stash_drafted_changes.
6 7 8 |
# File 'lib/draftsman/config.rb', line 6 def stash_drafted_changes @stash_drafted_changes end |
#timestamp_field ⇒ Object
Returns the value of attribute timestamp_field.
6 7 8 |
# File 'lib/draftsman/config.rb', line 6 def @timestamp_field end |
#whodunnit_field ⇒ Object
Returns the value of attribute whodunnit_field.
6 7 8 |
# File 'lib/draftsman/config.rb', line 6 def whodunnit_field @whodunnit_field end |
Instance Method Details
#enabled ⇒ Object
Indicates whether Draftsman is on or off. Default: true.
19 20 21 |
# File 'lib/draftsman/config.rb', line 19 def enabled @mutex.synchronize { !!@enabled } end |
#enabled=(enable) ⇒ Object
23 24 25 |
# File 'lib/draftsman/config.rb', line 23 def enabled=(enable) @mutex.synchronize { @enabled = enable } end |