Sha256: 63c7798b671dcc68427e2dfaff987feb6d937ff51f1f0bf4cb3e5773f1989df9

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

# frozen_string_literal: true

require 'rails/generators'

module Generalis
  module Generators
    class TransactionGenerator < Rails::Generators::NamedBase
      source_root File.expand_path('templates', __dir__)

      def create_transaction
        template 'transaction.rb.erb', "app/models/#{module_path}/#{file_name}.rb"
      end

      def file_name
        class_name.underscore
      end

      def class_name
        "#{name.to_s.classify.chomp('Transaction')}Transaction"
      end

      def module_name
        module_path.classify
      end

      def module_path
        'ledger'
      end

      hook_for :test_framework
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
generalis-0.1.0 lib/generators/generalis/transaction_generator.rb