Sha256: 4002d0669a3e8dd84492b3f604ea5d6e072556a4ff7e10687dc41149613e6bf1

Contents?: true

Size: 449 Bytes

Versions: 7

Compression:

Stored size: 449 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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vedeu-0.0.39 lib/vedeu/models/command.rb
vedeu-0.0.38 lib/vedeu/models/command.rb
vedeu-0.0.37 lib/vedeu/models/command.rb
vedeu-0.0.36 lib/vedeu/models/command.rb
vedeu-0.0.35 lib/vedeu/models/command.rb
vedeu-0.0.34 lib/vedeu/models/command.rb
vedeu-0.0.33 lib/vedeu/models/command.rb