Sha256: 1bf64ee900b6b2546cc7c5b69255690380ab08478115b3746143e2ae36628154

Contents?: true

Size: 346 Bytes

Versions: 1

Compression:

Stored size: 346 Bytes

Contents

require "json"
require "securerandom"

module Undead
  class Command
    attr_reader :id
    attr_reader :name
    attr_accessor :args

    def initialize(name, *args)
      @id = SecureRandom.uuid
      @name = name
      @args = args
    end

    def message
      JSON.dump({ 'id' => @id, 'name' => @name, 'args' => @args })
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
undead-0.2.0 lib/undead/command.rb