Class: Swappy::Commands::Swap

Inherits:
Command
  • Object
show all
Defined in:
lib/swappy/commands/swap.rb

Constant Summary collapse

ConfigSetNotFoundError =
Class.new(StandardError)

Instance Attribute Summary collapse

Attributes inherited from Command

#app_config_path, #options

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Swap

Returns a new instance of Swap.



10
11
12
13
14
# File 'lib/swappy/commands/swap.rb', line 10

def initialize(options={})
  super options
  @name = options[:name]
  raise ConfigSetNotFoundError unless config_set
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/swappy/commands/swap.rb', line 6

def name
  @name
end

Instance Method Details

#callObject



16
17
18
# File 'lib/swappy/commands/swap.rb', line 16

def call
  switch_to_config_set
end