Sha256: 461faaa06cf9612976d330598e3b8f0922040c2aba8364ad18ca58099efeebbd

Contents?: true

Size: 431 Bytes

Versions: 26

Compression:

Stored size: 431 Bytes

Contents

module Locomotive
  module Wagon

    class ContentAssetDecorator < Struct.new(:filepath)

      include ToHashConcern

      def __attributes__
        %i(source)
      end

      def source
        Locomotive::Coal::UploadIO.new(filepath, nil, filename)
      end

      def checksum
        Digest::MD5.hexdigest(File.read(filepath))
      end

      def filename
        File.basename(filepath)
      end

    end

  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
locomotivecms_wagon-2.2.0 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.2.0.rc3 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.2.0.rc2 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.2.0.rc1 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.2.0.beta1 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.1.1 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.1.0 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.1.0.rc5 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.1.0.rc4 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.1.0.rc3 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.0.1 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.0.0 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.0.0.rc8 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.0.0.rc7 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.0.0.rc6 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.0.0.rc5 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.0.0.rc4 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.0.0.rc3 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.0.0.rc2 lib/locomotive/wagon/decorators/content_asset_decorator.rb
locomotivecms_wagon-2.0.0.rc1 lib/locomotive/wagon/decorators/content_asset_decorator.rb