module Attachie

Constants

VERSION

Public Class Methods

default_options() click to toggle source
# File lib/attachie.rb, line 12
def self.default_options
  @default_options ||= { :protocol => "http" }
end
included(base) click to toggle source
# File lib/attachie.rb, line 152
def self.included(base)
  base.class_attribute :attachments
  base.attachments = {}

  base.extend ClassMethods
end

Public Instance Methods

attachment(name) click to toggle source
# File lib/attachie.rb, line 159
def attachment(name)
  definition = self.class.attachments[name]

  raise(UnknownAttachment) unless definition

  Attachment.new(self, name, definition)
end