File: command.rb

package info (click to toggle)
ruby-poltergeist 1.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 368 kB
  • sloc: ruby: 1,528; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 377 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'securerandom'

module Capybara::Poltergeist
  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