Sha256: d3a5ec67218f68e5d25fa00c382cd0be9591d2e1f3c5bd166ddcf05a04b619b6

Contents?: true

Size: 709 Bytes

Versions: 9

Compression:

Stored size: 709 Bytes

Contents

# frozen_string_literal: true

require_relative '../../command'

module Vtk
  module Commands
    class Module
      # Adds a new module service class to vets-api
      class Service < Vtk::Command
        attr_accessor :name, :options

        def initialize(name, options)
          @name = name
          @options = options

          super()
        end

        def execute(_input: $stdin, _output: $stdout)
          create_service(name, options)
        end

        private

        def create_service(name, options)
          module_name = options[:module_name]
          system("rails g module_component #{module_name} method:service component_name:#{name}")
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vtk-1.0.0 lib/vtk/commands/module/service.rb
vtk-0.9.5 lib/vtk/commands/module/service.rb
vtk-0.9.4 lib/vtk/commands/module/service.rb
vtk-0.9.3 lib/vtk/commands/module/service.rb
vtk-0.9.2 lib/vtk/commands/module/service.rb
vtk-0.9.1 lib/vtk/commands/module/service.rb
vtk-0.9.0 lib/vtk/commands/module/service.rb
vtk-0.8.0 lib/vtk/commands/module/service.rb
vtk-0.7.0 lib/vtk/commands/module/service.rb