Sha256: a7bd36cdbbdd4d7f6b3de111118200314812397c0756e154dba2410ae97f177e

Contents?: true

Size: 596 Bytes

Versions: 18

Compression:

Stored size: 596 Bytes

Contents

module Pantograph
  # Represents a command that is meant to signal the server to do something on the client's behalf
  # Examples are: :cancelPantographRune, and :done
  class ControlCommand
    attr_reader :command
    attr_reader :user_message
    attr_reader :reason

    def initialize(json: nil)
      @command = json['command'].to_sym
      @user_message = json['userMessage']
      @reason = json['reason'].to_sym if json['reason']
    end

    def cancel_signal?
      return @command == :cancelPantographRun
    end

    def done_signal?
      return @command == :done
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
pantograph-0.1.22 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.21 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.20 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.19 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.17 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.16 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.15 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.14 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.13 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.12 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.10 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.8 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.7 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.6 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.4 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.3 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.1 pantograph/lib/pantograph/server/control_command.rb
pantograph-0.1.0 pantograph/lib/pantograph/server/control_command.rb