Class: ActiveShrine::Attached::Changes::CreateOne
- Inherits:
-
Object
- Object
- ActiveShrine::Attached::Changes::CreateOne
- Defined in:
- lib/active_shrine/attached/changes/create_one.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attachable ⇒ Object
readonly
Returns the value of attribute attachable.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #attachment ⇒ Object
-
#initialize(name, record, attachable) ⇒ CreateOne
constructor
A new instance of CreateOne.
- #save ⇒ Object
Constructor Details
#initialize(name, record, attachable) ⇒ CreateOne
Returns a new instance of CreateOne.
12 13 14 15 16 17 18 |
# File 'lib/active_shrine/attached/changes/create_one.rb', line 12 def initialize(name, record, attachable) @name = name @record = record @attachable = attachable attach end |
Instance Attribute Details
#attachable ⇒ Object (readonly)
Returns the value of attribute attachable.
10 11 12 |
# File 'lib/active_shrine/attached/changes/create_one.rb', line 10 def attachable @attachable end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/active_shrine/attached/changes/create_one.rb', line 10 def name @name end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
10 11 12 |
# File 'lib/active_shrine/attached/changes/create_one.rb', line 10 def record @record end |
Instance Method Details
#attachment ⇒ Object
20 21 22 |
# File 'lib/active_shrine/attached/changes/create_one.rb', line 20 def @attachment ||= end |
#save ⇒ Object
24 25 26 |
# File 'lib/active_shrine/attached/changes/create_one.rb', line 24 def save record.public_send(:"#{name}_attachment=", ) end |