Class: Rundoc::CodeCommand::RundocCommand::EnsureLaterArgs
- Inherits:
-
Object
- Object
- Rundoc::CodeCommand::RundocCommand::EnsureLaterArgs
- Defined in:
- lib/rundoc/code_command/rundoc/ensure_later.rb
Constant Summary collapse
- MAPPING =
{ cwd: ->(context:) { Dir.pwd }, rundoc_root: ->(context:) { context.output_dir.to_s } }.freeze
Instance Method Summary collapse
- #call(context:) ⇒ Object
-
#initialize(dir:) ⇒ EnsureLaterArgs
constructor
A new instance of EnsureLaterArgs.
- #to_s ⇒ Object
Constructor Details
#initialize(dir:) ⇒ EnsureLaterArgs
Returns a new instance of EnsureLaterArgs.
15 16 17 18 |
# File 'lib/rundoc/code_command/rundoc/ensure_later.rb', line 15 def initialize(dir:) @dir = dir @logic = MAPPING[dir] or raise ArgumentError, "Invalid argument dir: #{dir} must be one of #{MAPPING.keys}" end |
Instance Method Details
#call(context:) ⇒ Object
20 21 22 |
# File 'lib/rundoc/code_command/rundoc/ensure_later.rb', line 20 def call(context:) @logic.call(context: context) end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/rundoc/code_command/rundoc/ensure_later.rb', line 24 def to_s @dir end |