Class: Sshster::App

Inherits:
Object
  • Object
show all
Defined in:
lib/sshster/app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ App

Returns a new instance of App.



10
11
12
# File 'lib/sshster/app.rb', line 10

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



8
9
10
# File 'lib/sshster/app.rb', line 8

def options
  @options
end

Instance Method Details

#action_composeObject



27
28
29
30
# File 'lib/sshster/app.rb', line 27

def action_compose
  action_init
  Actions::Compose.new(config).run
end

#action_helpObject



32
33
34
# File 'lib/sshster/app.rb', line 32

def action_help
  Actions::Help.new.run
end

#action_initObject



23
24
25
# File 'lib/sshster/app.rb', line 23

def action_init
  Actions::Init.new(config).run
end

#runObject



14
15
16
17
18
19
20
21
# File 'lib/sshster/app.rb', line 14

def run
  case command
  when :init then action_init
  when :compose then action_compose
  when :help then action_help
  else action_help
  end
end