Sha256: 38698a733857acca5e9fea80640fb333a4a8697566aafdb5df931252735071de

Contents?: true

Size: 415 Bytes

Versions: 6

Compression:

Stored size: 415 Bytes

Contents

module Attachs
  module Types
    class Base

      def initialize(attachment)
        @attachment = attachment
      end

      protected

      attr_reader :attachment

      def storage
        @storage ||= begin
          klass = (attachment.options[:storage] || Attachs.config.default_storage).to_s.classify
          Attachs::Storages.const_get(klass).new(attachment)
        end
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
attachs-0.4.5 lib/attachs/types/base.rb
attachs-0.4.4 lib/attachs/types/base.rb
attachs-0.4.3 lib/attachs/types/base.rb
attachs-0.4.2 lib/attachs/types/base.rb
attachs-0.4.1 lib/attachs/types/base.rb
attachs-0.4.0 lib/attachs/types/base.rb