Module: Recorder

Defined in:
lib/recorder.rb,
lib/recorder/tape.rb,
lib/recorder/store.rb,
lib/recorder/config.rb,
lib/recorder/manager.rb,
lib/recorder/version.rb,
lib/recorder/observer.rb,
lib/recorder/revision.rb,
lib/recorder/changeset.rb,
lib/recorder/tape/data.rb,
lib/recorder/tape/record.rb,
lib/recorder/rails/railtie.rb,
lib/recorder/rails/controller_concern.rb,
lib/recorder/sidekiq/revisions_worker.rb,
lib/generators/recorder/install_generator.rb

Defined Under Namespace

Modules: Manager, Observer, Rails, Sidekiq Classes: Changeset, Config, InstallGenerator, Revision, Store, Tape

Constant Summary collapse

VERSION =
'1.2.1'

Class Method Summary collapse

Class Method Details

.active_record_protected_attributes?Boolean

Returns a boolean indicating whether “protected attibutes” should be configured, e.g. attr_accessible.

Returns:

  • (Boolean)


43
44
45
# File 'lib/recorder.rb', line 43

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.

Yields:



49
50
51
52
53
# File 'lib/recorder.rb', line 49

def config
  @config ||= Recorder::Config.instance
  yield @config if block_given?
  @config
end

.enabled=(value) ⇒ Object

Switches Recorder on or off.



18
19
20
# File 'lib/recorder.rb', line 18

def enabled=(value)
  Recorder.config.enabled = value
end

.enabled?Boolean

Returns ‘true` if Recorder is on, `false` otherwise. Recorder is enabled by default.

Returns:

  • (Boolean)


25
26
27
# File 'lib/recorder.rb', line 25

def enabled?
  !!Recorder.config.enabled
end

.info=(hash) ⇒ Object

Sets Recorder information from the controller.



31
32
33
# File 'lib/recorder.rb', line 31

def info=(hash)
  store.params.merge!(hash)
end

.meta=(hash) ⇒ Object

Sets Recorder meta information.



37
38
39
# File 'lib/recorder.rb', line 37

def meta=(hash)
  store.params[:meta] = hash
end

.storeObject

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.



57
58
59
# File 'lib/recorder.rb', line 57

def store
  @store ||= Recorder::Store.new
end

.versionObject

Returns version of Recorder as String



62
63
64
# File 'lib/recorder.rb', line 62

def version
  VERSION::STRING
end