Class: Nexmo::Markdown::Filters::CodeSnippet::Run
- Inherits:
-
Object
- Object
- Nexmo::Markdown::Filters::CodeSnippet::Run
- Includes:
- Renderable
- Defined in:
- lib/nexmo_markdown_renderer/filters/code_snippet/run.rb
Instance Method Summary collapse
-
#initialize(config, snippet) ⇒ Run
constructor
A new instance of Run.
- #render ⇒ Object
- #run_command ⇒ Object
Methods included from Renderable
#client_url, #id, #normalized_language, #renderer
Constructor Details
#initialize(config, snippet) ⇒ Run
Returns a new instance of Run.
8 9 10 11 |
# File 'lib/nexmo_markdown_renderer/filters/code_snippet/run.rb', line 8 def initialize(config, snippet) @config = config @snippet = snippet end |
Instance Method Details
#render ⇒ Object
21 22 23 |
# File 'lib/nexmo_markdown_renderer/filters/code_snippet/run.rb', line 21 def render renderer.run_command(run_command, file_name, @config['code']['source']).to_s end |
#run_command ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/nexmo_markdown_renderer/filters/code_snippet/run.rb', line 13 def run_command @run_command ||= begin if @config['run_command'] @config['run_command'].gsub('{filename}', file_name) end end end |