Class: Sinicum::Imaging::ImagingFile

Inherits:
Object
  • Object
show all
Defined in:
lib/sinicum/imaging/imaging_file.rb

Overview

Representation of a DAM file as seen by the imaging middleware.

Constant Summary collapse

ORIGINAL_DAM_PATH_START =
::Sinicum::Imaging.dam_path_prefix + "/"
ORIGINAL_DAM_PATH_REPLACEMENT =
::Sinicum::Imaging.path_prefix + "/" +
::Sinicum::Imaging.default_converter_name + "/"
ORIGINAL_DMS_PATH_START =
::Sinicum::Imaging.dms_path_prefix + "/"
ORIGINAL_DMS_PATH_REPLACEMENT =
::Sinicum::Imaging.path_prefix_mgnl4 + "/" +
::Sinicum::Imaging.default_converter_name + "/"
DEFAULT_CACHE_TIME =
24 * 60 * 60
FINGERPRINT_CACHE_TIME =
7 * 24 * 60 * 60

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path_info) ⇒ ImagingFile

Public: Create a new instance

path_info - The request’s path_info



20
21
22
23
# File 'lib/sinicum/imaging/imaging_file.rb', line 20

def initialize(path_info)
  @path_info = path_info
  set_up
end

Instance Attribute Details

#extensionObject (readonly)

Returns the value of attribute extension.



15
16
17
# File 'lib/sinicum/imaging/imaging_file.rb', line 15

def extension
  @extension
end

#fingerprintObject (readonly)

Returns the value of attribute fingerprint.



15
16
17
# File 'lib/sinicum/imaging/imaging_file.rb', line 15

def fingerprint
  @fingerprint
end

#normalized_request_pathObject (readonly)

Returns the value of attribute normalized_request_path.



15
16
17
# File 'lib/sinicum/imaging/imaging_file.rb', line 15

def normalized_request_path
  @normalized_request_path
end

#workspaceObject (readonly)

Returns the value of attribute workspace.



15
16
17
# File 'lib/sinicum/imaging/imaging_file.rb', line 15

def workspace
  @workspace
end

Instance Method Details

#cache_timeObject



37
38
39
40
41
42
43
# File 'lib/sinicum/imaging/imaging_file.rb', line 37

def cache_time
  if fingerprint
    FINGERPRINT_CACHE_TIME
  else
    DEFAULT_CACHE_TIME
  end
end

#filenameObject



33
34
35
# File 'lib/sinicum/imaging/imaging_file.rb', line 33

def filename
  imaging_result.filename
end

#pathObject



29
30
31
# File 'lib/sinicum/imaging/imaging_file.rb', line 29

def path
  imaging_result.path
end

#result?Boolean

Returns:



25
26
27
# File 'lib/sinicum/imaging/imaging_file.rb', line 25

def result?
  !!imaging_result
end