Class: AuditBuilder
- Inherits:
-
Object
- Object
- AuditBuilder
- Defined in:
- lib/audit_builder.rb
Constant Summary collapse
- FALLBACKS_FOR_WITH =
[:attributes, :inspect]
- FALLBACKS_FOR_ID =
[:to_param, :id, :object_id]
Instance Attribute Summary collapse
-
#audit_name ⇒ Object
Returns the value of attribute audit_name.
-
#object ⇒ Object
Returns the value of attribute object.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #create_audit ⇒ Object
-
#initialize(object, audit_name, options = {}) ⇒ AuditBuilder
constructor
A new instance of AuditBuilder.
Constructor Details
#initialize(object, audit_name, options = {}) ⇒ AuditBuilder
Returns a new instance of AuditBuilder.
6 7 8 9 10 |
# File 'lib/audit_builder.rb', line 6 def initialize(object, audit_name, = {}) @object = object @audit_name = audit_name @options = end |
Instance Attribute Details
#audit_name ⇒ Object
Returns the value of attribute audit_name.
5 6 7 |
# File 'lib/audit_builder.rb', line 5 def audit_name @audit_name end |
#object ⇒ Object
Returns the value of attribute object.
5 6 7 |
# File 'lib/audit_builder.rb', line 5 def object @object end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/audit_builder.rb', line 5 def @options end |
Instance Method Details
#create_audit ⇒ Object
11 12 13 14 15 16 |
# File 'lib/audit_builder.rb', line 11 def create_audit Audit.create :auditable_type => extract_auditable_type, :auditable_id => extract_auditable_id, :changes => extract_changes, :action => @audit_name.to_s end |