Module: Recorder
- Defined in:
- lib/recorder.rb,
lib/recorder/tape.rb,
lib/recorder/config.rb,
lib/recorder/version.rb,
lib/recorder/observer.rb,
lib/recorder/changeset.rb,
lib/recorder/rails/controller_concern.rb,
lib/recorder/sidekiq/revisions_worker.rb,
lib/generators/recorder/install_generator.rb
Defined Under Namespace
Modules: Observer, Rails, Sidekiq, VERSION Classes: Changeset, Config, InstallGenerator, Revision, Tape
Class Method Summary collapse
-
.active_record_protected_attributes? ⇒ Boolean
Returns a boolean indicating whether “protected attibutes” should be configured, e.g.
-
.config {|@config| ... } ⇒ Object
private
Returns Recorder’s configuration object.
-
.enabled=(value) ⇒ Object
Switches Recorder on or off.
-
.enabled? ⇒ Boolean
Returns ‘true` if Recorder is on, `false` otherwise.
-
.info=(hash) ⇒ Object
Sets Recorder information from the controller.
-
.meta=(hash) ⇒ Object
Sets Recorder meta information.
-
.store ⇒ Object
private
Thread-safe hash to hold Recorder’s data.
-
.version ⇒ Object
Returns version of Recorder as
String.
Class Method Details
.active_record_protected_attributes? ⇒ Boolean
Returns a boolean indicating whether “protected attibutes” should be configured, e.g. attr_accessible.
39 40 41 |
# File 'lib/recorder.rb', line 39 def active_record_protected_attributes? @active_record_protected_attributes ||= !!defined?(ProtectedAttributes) end |
.config {|@config| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Recorder’s configuration object.
45 46 47 48 49 |
# File 'lib/recorder.rb', line 45 def config @config ||= Recorder::Config.instance yield @config if block_given? @config end |
.enabled=(value) ⇒ Object
Switches Recorder on or off.
14 15 16 |
# File 'lib/recorder.rb', line 14 def enabled=(value) Recorder.config.enabled = value end |
.enabled? ⇒ Boolean
Returns ‘true` if Recorder is on, `false` otherwise. Recorder is enabled by default.
21 22 23 |
# File 'lib/recorder.rb', line 21 def enabled? !!Recorder.config.enabled end |
.info=(hash) ⇒ Object
Sets Recorder information from the controller.
27 28 29 |
# File 'lib/recorder.rb', line 27 def info=(hash) self.store.merge!(hash) end |
.meta=(hash) ⇒ Object
Sets Recorder meta information.
33 34 35 |
# File 'lib/recorder.rb', line 33 def (hash) self.store[:meta] = hash end |
.store ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Thread-safe hash to hold Recorder’s data.
58 59 60 |
# File 'lib/recorder.rb', line 58 def store RequestStore.store[:recorder] ||= { } end |