Class: ActiveShrine::Attached::Changes::DeleteOne

Inherits:
Object
  • Object
show all
Defined in:
lib/active_shrine/attached/changes/delete_one.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, record) ⇒ DeleteOne

Returns a new instance of DeleteOne.



9
10
11
12
# File 'lib/active_shrine/attached/changes/delete_one.rb', line 9

def initialize(name, record)
  @name = name
  @record = record
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/active_shrine/attached/changes/delete_one.rb', line 7

def name
  @name
end

#recordObject (readonly)

Returns the value of attribute record.



7
8
9
# File 'lib/active_shrine/attached/changes/delete_one.rb', line 7

def record
  @record
end

Instance Method Details

#attachmentObject



14
15
16
# File 'lib/active_shrine/attached/changes/delete_one.rb', line 14

def attachment
  nil
end

#saveObject



18
19
20
# File 'lib/active_shrine/attached/changes/delete_one.rb', line 18

def save
  record.public_send(:"#{name}_attachment=", nil)
end