Class: Exekutor::Internal::CLI::DefaultOptionValue
- Inherits:
-
Object
- Object
- Exekutor::Internal::CLI::DefaultOptionValue
- Defined in:
- lib/exekutor/internal/cli/default_option_value.rb
Overview
Used as a default value for CLI flags.
Direct Known Subclasses
Manager::DefaultConfigFileValue, Manager::DefaultPidFileValue
Instance Method Summary collapse
-
#initialize(description = nil, value: nil) ⇒ DefaultOptionValue
constructor
A new instance of DefaultOptionValue.
-
#to_s ⇒ Object
The value to display in the CLI help message.
-
#value ⇒ Object
The actual value, if set.
Constructor Details
#initialize(description = nil, value: nil) ⇒ DefaultOptionValue
Returns a new instance of DefaultOptionValue.
10 11 12 13 |
# File 'lib/exekutor/internal/cli/default_option_value.rb', line 10 def initialize(description = nil, value: nil) @description = description || value&.to_s || "none" @value = value end |
Instance Method Details
#to_s ⇒ Object
The value to display in the CLI help message
16 17 18 |
# File 'lib/exekutor/internal/cli/default_option_value.rb', line 16 def to_s @description end |
#value ⇒ Object
The actual value, if set. If the value responds to call
, it will be called
21 22 23 24 25 26 27 |
# File 'lib/exekutor/internal/cli/default_option_value.rb', line 21 def value if @value.respond_to? :call @value.call else @value end end |