Class: Shellfie::FormatResolver
- Inherits:
-
Object
- Object
- Shellfie::FormatResolver
- Defined in:
- lib/shellfie/format_resolver.rb
Class Method Summary collapse
Class Method Details
.resolve(output_path, explicit:, default:) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/shellfie/format_resolver.rb', line 6 def resolve(output_path, explicit:, default:) return explicit if explicit return default if output_path == "-" extension = File.extname(output_path).delete_prefix(".") extension.empty? ? default : extension end |