Sha256: ab6ed3025a504997e2f38c52df425daa43bbb40649c24d2f0946e1f40e0525ee

Contents?: true

Size: 592 Bytes

Versions: 5

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

require_relative '../../command'

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

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

          super()
        end

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

        private

        def create_model(name)
          system("rails g module_component #{name} model")
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vtk-0.3.0 lib/vtk/commands/module/model.rb
vtk-0.2.6 lib/vtk/commands/module/model.rb
vtk-0.2.5 lib/vtk/commands/module/model.rb
vtk-0.2.4 lib/vtk/commands/module/model.rb
vtk-0.2.3 lib/vtk/commands/module/model.rb