Class: Sumcli::Commands::Add

Inherits:
Thor
  • Object
show all
Defined in:
lib/sumcli/commands/add.rb,
lib/sumcli/commands/add/service.rb,
lib/sumcli/commands/add/endpoint.rb,
lib/sumcli/commands/add/migration.rb

Defined Under Namespace

Classes: Endpoint, Migration, Service

Instance Method Summary collapse

Instance Method Details

#endpoint(name, method = nil, route = nil) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/sumcli/commands/add.rb', line 38

def endpoint(name, method = nil, route = nil)
  if options[:help]
    invoke :help, ['endpoint']
  else
    require_relative 'add/endpoint'
    Sumcli::Commands::Add::Endpoint.new(name, method, route, options).execute
  end
end

#migration(name) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/sumcli/commands/add.rb', line 14

def migration(name)
  if options[:help]
    invoke :help, ['migration']
  else
    require_relative 'add/migration'
    Sumcli::Commands::Add::Migration.new(name, options).execute
  end
end

#service(name, version = nil) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/sumcli/commands/add.rb', line 26

def service(name, version = nil)
  if options[:help]
    invoke :help, ['service']
  else
    require_relative 'add/service'
    Sumcli::Commands::Add::Service.new(name, version, options).execute
  end
end