class XRBP::WebSocket::Command

Attributes

id[RW]
json[R]

Public Class Methods

new(data) click to toggle source
Calls superclass method
# File lib/xrbp/websocket/command.rb, line 7
def initialize(data)
  @@id ||= 0
  @id = (@@id += 1)

  json = Hash[data]
  json['id'] = id

  @json = json

  super(json.to_json)
end

Public Instance Methods

requesting() click to toggle source
# File lib/xrbp/websocket/command.rb, line 19
def requesting
  @json[:command] || @json["command"]
end
requesting?(tgt) click to toggle source
# File lib/xrbp/websocket/command.rb, line 23
def requesting?(tgt)
  requesting.to_s == tgt.to_s
end