Module: Adrift::Integration::Base::InstanceMethods
- Defined in:
- lib/adrift/integration/base.rb
Overview
Methods that handle the communication with the Attachments of a given model.
They are included in the model class by Base#attachment.
Instance Method Summary collapse
-
#attachments ⇒ Object
Attachment objects that belongs to the model.
-
#destroy_attachments ⇒ Object
Sends the message :destroy to the Attachment objects that belongs to the model.
-
#save_attachments ⇒ Object
Sends the message :save to the Attachment objects that belongs to the model.
-
#send_to_attachments(message) ⇒ Object
Sends
message
to the Attachment objects that belongs to the model.
Instance Method Details
#attachments ⇒ Object
Attachment objects that belongs to the model. It needs the model class to be able to respond to attachment_definitions
with a Hash where the keys are the Attachment names.
14 15 16 |
# File 'lib/adrift/integration/base.rb', line 14 def self.class..keys.map { |name| send(name) } end |
#destroy_attachments ⇒ Object
Sends the message :destroy to the Attachment objects that belongs to the model.
32 33 34 |
# File 'lib/adrift/integration/base.rb', line 32 def (:destroy) end |
#save_attachments ⇒ Object
Sends the message :save to the Attachment objects that belongs to the model.
26 27 28 |
# File 'lib/adrift/integration/base.rb', line 26 def (:save) end |
#send_to_attachments(message) ⇒ Object
Sends message
to the Attachment objects that belongs to the model.
20 21 22 |
# File 'lib/adrift/integration/base.rb', line 20 def () .each { || .send() } end |