Class: Hydra::FileCharacterization::Characterizer
- Inherits:
-
Object
- Object
- Hydra::FileCharacterization::Characterizer
- Includes:
- Open3
- Defined in:
- lib/hydra/file_characterization/characterizer.rb
Direct Known Subclasses
Hydra::FileCharacterization::Characterizers::Ffprobe, Hydra::FileCharacterization::Characterizers::Fits, Hydra::FileCharacterization::Characterizers::FitsServlet
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(filename, tool_path = nil) ⇒ Characterizer
constructor
A new instance of Characterizer.
- #logger ⇒ Object
- #tool_path ⇒ Object
Constructor Details
#initialize(filename, tool_path = nil) ⇒ Characterizer
Returns a new instance of 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 (readonly)
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 |
#tool_path ⇒ Object
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 |