Sha256: 47ae9e74547cd8e51e0b4930bc4fe651d3dc292709cb699cb2b08c8c0448d028

Contents?: true

Size: 584 Bytes

Versions: 2

Compression:

Stored size: 584 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)
          `rails g module_component #{name} model`
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vtk-0.2.2 lib/vtk/commands/module/model.rb
vtk-0.2.1 lib/vtk/commands/module/model.rb