Class: Hydra::FileCharacterization::Characterizer
- Inherits:
-
Object
- Object
- Hydra::FileCharacterization::Characterizer
show all
- Includes:
- Open3
- Defined in:
- lib/hydra/file_characterization/characterizer.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(filename, tool_path = nil) ⇒ Characterizer
13
14
15
16
|
# File 'lib/hydra/file_characterization/characterizer.rb', line 13
def initialize(filename, tool_path = nil)
@filename = filename
@tool_path = tool_path
end
|
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
12
13
14
|
# File 'lib/hydra/file_characterization/characterizer.rb', line 12
def filename
@filename
end
|
Instance Method Details
#call ⇒ Object
18
19
20
21
22
|
# File 'lib/hydra/file_characterization/characterizer.rb', line 18
def call
raise Hydra::FileCharacterization::FileNotFoundError, "File: #{filename} does not exist." unless File.exist?(filename)
post_process(output)
end
|
#logger ⇒ Object
28
29
30
|
# File 'lib/hydra/file_characterization/characterizer.rb', line 28
def logger
@logger ||= activefedora_logger || Logger.new(STDERR)
end
|
24
25
26
|
# File 'lib/hydra/file_characterization/characterizer.rb', line 24
def tool_path
@tool_path || self.class.tool_path || convention_based_tool_name
end
|