Class: YtDlp::OptionsConverter
- Inherits:
-
Object
- Object
- YtDlp::OptionsConverter
- Defined in:
- lib/yt_dlp/options_converter.rb
Overview
Class responsible for converting a ruby Hash into valid yt-dlp options. Convert the option Hash into valid yt-dlp options. (key,value) pairs are transformed according to the following rules
-
{ key: value } –> ‘–key value’
-
{ my_key: value } –> ‘–my-key value’. Allow dev to keep using ruby naming conventions
-
{ key: true } –> ‘–key’
-
{ key: false } –> ‘–no-key’
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ OptionsConverter
constructor
Initialize the runner options.
-
#to_command_options ⇒ String
Convert the option Hash into valid yt-dlp options.
Constructor Details
#initialize(options = {}) ⇒ OptionsConverter
Initialize the runner options.
21 22 23 |
# File 'lib/yt_dlp/options_converter.rb', line 21 def initialize( = {}) = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/yt_dlp/options_converter.rb', line 14 def end |
Instance Method Details
#to_command_options ⇒ String
Convert the option Hash into valid yt-dlp options. (key,value) pairs are transformed according to the following rules
-
{ key: value } –> ‘–key value’
-
{ my_key: value } –> ‘–my-key value’. Allow dev to keep using ruby naming conventions
-
{ key: true } –> ‘–key’
-
{ key: false } –> ‘–no-key’
35 36 37 |
# File 'lib/yt_dlp/options_converter.rb', line 35 def ||= end |