Class: Capybara::Poltergeist::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/poltergeist/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, *args) ⇒ Command

Returns a new instance of Command.



11
12
13
14
15
# File 'lib/capybara/poltergeist/command.rb', line 11

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

Instance Attribute Details

#argsObject

Returns the value of attribute args.



9
10
11
# File 'lib/capybara/poltergeist/command.rb', line 9

def args
  @args
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/capybara/poltergeist/command.rb', line 7

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/capybara/poltergeist/command.rb', line 8

def name
  @name
end

Instance Method Details

#messageObject



17
18
19
# File 'lib/capybara/poltergeist/command.rb', line 17

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