Sha256: c691540399315edd0664aec5906a95f8c72110c854a29b8ff34f8d2f50575c1e

Contents?: true

Size: 531 Bytes

Versions: 1

Compression:

Stored size: 531 Bytes

Contents

# frozen_string_literal: true

module TooDoo
  module Commands
    # Base class represents template for command entity
    # it provides common logic for all commands
    class Base
      attr_reader :args, :store

      def initialize(args, store = Store)
        @args = args
        @store = store.new
      end

      def description
        ''
      end

      def run!
        return puts description if args.empty?
        perform!
      end

      def perform!
        raise NotImplementedError
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
toodoo-0.1.1 lib/toodoo/commands/base.rb