Sha256: 0fecd3ccc495bf17e9fac6610171d03aa6745193f0e08a59d96cbaceda62fd0b

Contents?: true

Size: 630 Bytes

Versions: 14

Compression:

Stored size: 630 Bytes

Contents

# Nieve implementation of IO wrapper class that adds mime_type and original_name attributes.
# This is done so the attributes do not have to be passed as additional arguments,
#  and are attached properly to the object they describe.
#
#
#  Use SimpleDelegator to wrap the given class or instance
require 'delegate'

module Hydra
  module Derivatives
    class IoDecorator < SimpleDelegator
      attr_accessor :mime_type, :original_name

      def initialize(file, mime_type = nil, original_name = nil)
        super(file)
        self.mime_type = mime_type
        self.original_name = original_name
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hydra-derivatives-3.3.2 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.3.1 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.3.0 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.2.2 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.2.1 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.2.0 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.1.4 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.1.3 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.1.2 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.1.1 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.1.0 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.0.2 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.0.1 lib/hydra/derivatives/io_decorator.rb
hydra-derivatives-3.0.0 lib/hydra/derivatives/io_decorator.rb