Module: Attachie

Defined in:
lib/attachie.rb,
lib/attachie/version.rb,
lib/attachie/s3_driver.rb,
lib/attachie/fake_driver.rb,
lib/attachie/file_driver.rb,
lib/attachie/interpolation.rb

Defined Under Namespace

Modules: ClassMethods Classes: Attachment, BaseError, FakeDriver, FakeMultipartUpload, FileDriver, Interpolation, InterpolationError, ItemNotFound, NoSuchVersion, NotSupported, S3Driver, S3MultipartUpload, UnknownAttachment

Constant Summary collapse

VERSION =
"2.0.0"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_optionsObject



14
15
16
# File 'lib/attachie.rb', line 14

def self.default_options
  @default_options ||= { :protocol => "http" }
end

.included(base) ⇒ Object



154
155
156
157
158
159
# File 'lib/attachie.rb', line 154

def self.included(base)
  base.class_attribute :attachments
  base.attachments = {}

  base.extend ClassMethods
end

Instance Method Details

#attachment(name) ⇒ Object

Raises:



161
162
163
164
165
166
167
# File 'lib/attachie.rb', line 161

def attachment(name)
  definition = self.class.attachments[name]

  raise(UnknownAttachment) unless definition

  Attachment.new(self, name, definition)
end