Class: Mode::Commands::Connect
- Inherits:
-
Object
- Object
- Mode::Commands::Connect
- Includes:
- Helpers
- Defined in:
- lib/mode/commands/connect.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#concurrency ⇒ Object
readonly
Returns the value of attribute concurrency.
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(command, options = {}) ⇒ Connect
constructor
A new instance of Connect.
Methods included from Helpers
#config_dir, #config_exists?, #config_path, #configure_api_requests!, #connect_config_exists?, #require_config!, #require_connect_config!, #require_credentials!, #timer_block
Constructor Details
#initialize(command, options = {}) ⇒ Connect
Returns a new instance of Connect.
11 12 13 14 15 16 17 18 |
# File 'lib/mode/commands/connect.rb', line 11 def initialize(command, = {}) @command = command @concurrency = [:concurrency] || 4 validate! @configuration = Mode::Connector::Config.new(config_dir) end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
7 8 9 |
# File 'lib/mode/commands/connect.rb', line 7 def command @command end |
#concurrency ⇒ Object (readonly)
Returns the value of attribute concurrency.
8 9 10 |
# File 'lib/mode/commands/connect.rb', line 8 def concurrency @concurrency end |
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
9 10 11 |
# File 'lib/mode/commands/connect.rb', line 9 def configuration @configuration end |
Instance Method Details
#execute ⇒ Object
20 21 22 23 |
# File 'lib/mode/commands/connect.rb', line 20 def execute register! if ['start', 'restart'].include?(command) spawn! end |