Class: Magick::AuditLog::Entry
- Inherits:
-
Object
- Object
- Magick::AuditLog::Entry
- Defined in:
- lib/magick/audit_log.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
-
#feature_name ⇒ Object
readonly
Returns the value of attribute feature_name.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(feature_name, action, user_id: nil, changes: {}, metadata: {}) ⇒ Entry
constructor
A new instance of Entry.
- #to_h ⇒ Object
Constructor Details
#initialize(feature_name, action, user_id: nil, changes: {}, metadata: {}) ⇒ Entry
Returns a new instance of Entry.
8 9 10 11 12 13 14 15 |
# File 'lib/magick/audit_log.rb', line 8 def initialize(feature_name, action, user_id: nil, changes: {}, metadata: {}) @feature_name = feature_name.to_s @action = action.to_s @user_id = user_id @timestamp = Time.now @changes = changes @metadata = end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
6 7 8 |
# File 'lib/magick/audit_log.rb', line 6 def action @action end |
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
6 7 8 |
# File 'lib/magick/audit_log.rb', line 6 def changes @changes end |
#feature_name ⇒ Object (readonly)
Returns the value of attribute feature_name.
6 7 8 |
# File 'lib/magick/audit_log.rb', line 6 def feature_name @feature_name end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
6 7 8 |
# File 'lib/magick/audit_log.rb', line 6 def @metadata end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
6 7 8 |
# File 'lib/magick/audit_log.rb', line 6 def @timestamp end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
6 7 8 |
# File 'lib/magick/audit_log.rb', line 6 def user_id @user_id end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/magick/audit_log.rb', line 17 def to_h { feature_name: feature_name, action: action, user_id: user_id, timestamp: .iso8601, changes: changes, metadata: } end |