Module: AttachIt::InstanceMethods

Defined in:
lib/attach_it/attach_it.rb

Instance Method Summary collapse

Instance Method Details

#destroy_attachmentsObject



82
83
84
85
86
87
88
# File 'lib/attach_it/attach_it.rb', line 82

def destroy_attachments
  unless @attachment_options.nil?
    @attachment_options.keys.each do |name|
      @attachment_options[name].delete
    end
  end
end

#information_for(name = nil, options = nil) ⇒ Object



69
70
71
72
# File 'lib/attach_it/attach_it.rb', line 69

def information_for(name = nil, options = nil)
  @attachment_options ||= {}
  @attachment_options[name] ||= AttachmentOptions.new(self, name, options)
end

#save_attachmentsObject



74
75
76
77
78
79
80
# File 'lib/attach_it/attach_it.rb', line 74

def save_attachments
  unless @attachment_options.nil?
    @attachment_options.keys.each do |name|
      @attachment_options[name].save
    end
  end
end