Class: Rundoc::CodeCommand::Background::Log::Clear
- Inherits:
-
Rundoc::CodeCommand
- Object
- Rundoc::CodeCommand
- Rundoc::CodeCommand::Background::Log::Clear
- Defined in:
- lib/rundoc/code_command/background/log/clear.rb
Constant Summary
Constants inherited from Rundoc::CodeCommand
NEWLINE, RUNDOC_DEFAULT_ERB_BINDING, RUNDOC_ERB_BINDINGS
Instance Attribute Summary
Attributes inherited from Rundoc::CodeCommand
#command, #contents, #keyword, #original_args, #render_command, #render_result
Instance Method Summary collapse
- #background ⇒ Object
- #call(env = {}) ⇒ Object
-
#initialize(name:) ⇒ Clear
constructor
A new instance of Clear.
- #to_md(env = {}) ⇒ Object
Methods inherited from Rundoc::CodeCommand
Constructor Details
#initialize(name:) ⇒ Clear
Returns a new instance of Clear.
3 4 5 6 |
# File 'lib/rundoc/code_command/background/log/clear.rb', line 3 def initialize(name:) @name = name @background = nil end |
Instance Method Details
#background ⇒ Object
8 9 10 |
# File 'lib/rundoc/code_command/background/log/clear.rb', line 8 def background @background ||= Rundoc::CodeCommand::Background::ProcessSpawn.find(@name) end |
#call(env = {}) ⇒ Object
16 17 18 19 |
# File 'lib/rundoc/code_command/background/log/clear.rb', line 16 def call(env = {}) background.log.truncate(0) "" end |
#to_md(env = {}) ⇒ Object
12 13 14 |
# File 'lib/rundoc/code_command/background/log/clear.rb', line 12 def to_md(env = {}) "" end |