Sha256: 24eb541d046ed66900f8e08dcbe4859112c8bd4367d00728f519404e8cf00ed8

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

# Blob methods for exporting.
# Exclusively for the Blob class.

class Blob

  # Get the blob export's directory name, e.g. "/my/photos"
  #
  # The implementation simply calls #file_dir.
  # Override this when an export needs a custom directory base.
  #
  # @return [String] the blob export's directory name
  #
  def export_dir
    file_dir
  end

  # Get the blob export's base name, e.g. "photo.jpg"
  #
  # The implementation simply calls #file_base.
  # Override this when an export needs a custom base name.
  #
  # @return [String] the blob export's base name
  #
  def export_base
    file_base
  end

  # Get the blob export's path, e.g. "/my/photos/photo.jpg"
  #
  # The implementation simply calls #file_path.
  # Override this when an export needs a custom path.
  #
  # @return [String] the blob export's path
  #
  def export_path
    export_pathname.to_s
  end

  # Get the blob export's pathname, e.g. Pathname("/my/photos/photo.jpg")
  #
  # The implementation simply calls #file_pathname.
  # Override this when an export needs a custom path.
  #
  # @return [String] the file's path suitable for export
  #
  def export_pathname
    Pathname(export_dir) + export_base
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sixarm_ruby_blob-1.0.3 lib/sixarm_ruby_blob/export.rb
sixarm_ruby_blob-1.0.1 lib/sixarm_ruby_blob/export.rb