Sha256: 1f888655d571308f29747cac6aa51ee4d75b5a99edc52a3f7154ce9cbcf09a9b

Contents?: true

Size: 421 Bytes

Versions: 2

Compression:

Stored size: 421 Bytes

Contents

require 'virtus'

module Vedeu
  class Command
    include Virtus.model

    attribute :name,      String
    attribute :entity,    Class
    attribute :keyword,   String, default: ''
    attribute :keypress,  String, default: ''
    attribute :arguments, Array,  default: []

    def execute(*args)
      executable.call(*args)
    end

    def executable
      proc { |*args| entity.dispatch(*args) }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.0.32 lib/vedeu/models/command.rb
vedeu-0.0.31 lib/vedeu/models/command.rb