Class: Capybara::AsyncRunner::Command
- Inherits:
-
Object
- Object
- Capybara::AsyncRunner::Command
- Includes:
- Capybara::AsyncRunner::Commands::Configuration, Capybara::AsyncRunner::Commands::Responders, Capybara::AsyncRunner::Commands::Templates
- Defined in:
- lib/capybara/async_runner/command.rb
Overview
A common class for defining your commands
Every command MUST have a name and a .js.erb file
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Command
constructor
A new instance of Command.
-
#invoke ⇒ Object
Invokes the command and returns its result.
Methods included from Capybara::AsyncRunner::Commands::Templates
Methods included from Capybara::AsyncRunner::Commands::Responders
Methods included from Capybara::AsyncRunner::Commands::Configuration
Constructor Details
#initialize(data = {}) ⇒ Command
Returns a new instance of Command.
33 34 35 36 |
# File 'lib/capybara/async_runner/command.rb', line 33 def initialize(data = {}) @uuid = SecureRandom.uuid @env = Capybara::AsyncRunner::Env.new(uuid, data, responders) end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
38 39 40 |
# File 'lib/capybara/async_runner/command.rb', line 38 def env @env end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
38 39 40 |
# File 'lib/capybara/async_runner/command.rb', line 38 def uuid @uuid end |
Instance Method Details
#invoke ⇒ Object
Invokes the command and returns its result
45 46 47 |
# File 'lib/capybara/async_runner/command.rb', line 45 def invoke js_builder.result end |