Sha256: adbd4a3ab492d408daca5a8d7047732ee798218031173e827c78bed853ec2cfa

Contents?: true

Size: 587 Bytes

Versions: 1

Compression:

Stored size: 587 Bytes

Contents

module Vedeu
  module CommandRepository
    extend Repository
    extend self

    def by_keypress(input)
      query(entity, :keypress, input)
    end

    def by_keyword(input)
      query(entity, :keyword, input)
    end

    def create(attributes)
      super(Command.new(attributes))
    end

    def entity
      Command
    end
  end

  # :nocov:
  module ClassMethods
    def command(name, options = {})
      command_name = name.is_a?(Symbol) ? name.to_s : name

      CommandRepository.create({
        name: command_name
      }.merge!(options))
    end
  end
  # :nocov:
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.0.25 lib/vedeu/repository/command_repository.rb