Module: Resync::Client::Mixins::BitstreamResource

Defined in:
lib/resync/client/mixins/bitstream_resource.rb

Overview

A resource that refers to a bitsream within a zipped bitstream package.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#zip_package_delegateZipPackage

Returns the provider of the containing package, e.g. its manifest.

Returns:

  • (ZipPackage)

    the provider of the containing package, e.g. its manifest



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/resync/client/mixins/bitstream_resource.rb', line 11

module BitstreamResource
  attr_accessor :zip_package_delegate

  # @return [ZipPackage] the package containing the bitstream for this resource
  def containing_package
    @zip_package_delegate.zip_package
  end

  # @return [Bitstream] the bitstream for this resource
  def bitstream
    containing_package.bitstream_for(self)
  end
end

Instance Method Details

#bitstreamBitstream

Returns the bitstream for this resource.

Returns:

  • (Bitstream)

    the bitstream for this resource



20
21
22
# File 'lib/resync/client/mixins/bitstream_resource.rb', line 20

def bitstream
  containing_package.bitstream_for(self)
end

#containing_packageZipPackage

Returns the package containing the bitstream for this resource.

Returns:

  • (ZipPackage)

    the package containing the bitstream for this resource



15
16
17
# File 'lib/resync/client/mixins/bitstream_resource.rb', line 15

def containing_package
  @zip_package_delegate.zip_package
end