Class: Rundoc::CodeCommand::Website::NavigateRunner
- Inherits:
-
Object
- Object
- Rundoc::CodeCommand::Website::NavigateRunner
- Defined in:
- lib/rundoc/code_command/website/navigate.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#io ⇒ Object
readonly
Returns the value of attribute io.
Instance Method Summary collapse
- #call(env = {}) ⇒ Object
- #driver ⇒ Object
-
#initialize(user_args:, render_command:, render_result:, io:, contents: nil) ⇒ NavigateRunner
constructor
A new instance of NavigateRunner.
- #to_md(env = {}) ⇒ Object
Constructor Details
#initialize(user_args:, render_command:, render_result:, io:, contents: nil) ⇒ NavigateRunner
Returns a new instance of NavigateRunner.
15 16 17 18 19 20 |
# File 'lib/rundoc/code_command/website/navigate.rb', line 15 def initialize(user_args:, render_command:, render_result:, io:, contents: nil) @name = user_args.name @driver = nil @io = io @contents = contents.dup if contents && !contents.empty? end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
13 14 15 |
# File 'lib/rundoc/code_command/website/navigate.rb', line 13 def contents @contents end |
#io ⇒ Object (readonly)
Returns the value of attribute io.
13 14 15 |
# File 'lib/rundoc/code_command/website/navigate.rb', line 13 def io @io end |
Instance Method Details
#call(env = {}) ⇒ Object
30 31 32 33 34 |
# File 'lib/rundoc/code_command/website/navigate.rb', line 30 def call(env = {}) io.puts "website.navigate [#{@name}]: #{contents}" driver.safe_eval(contents, env) "" end |
#driver ⇒ Object
22 23 24 |
# File 'lib/rundoc/code_command/website/navigate.rb', line 22 def driver @driver ||= Rundoc::CodeCommand::Website::Driver.find(@name) end |
#to_md(env = {}) ⇒ Object
26 27 28 |
# File 'lib/rundoc/code_command/website/navigate.rb', line 26 def to_md(env = {}) "" end |