Module: MachineGun::Commands

Defined in:
lib/machine-gun/commands.rb

Class Method Summary collapse

Class Method Details

.ping(input) ⇒ Object



3
4
5
# File 'lib/machine-gun/commands.rb', line 3

def self.ping(input)
  Bridge.command('ping', input)["pong"]
end

.request(method, url, headers, payload = nil) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/machine-gun/commands.rb', line 15

def self.request(method, url, headers, payload=nil)
  Bridge.command('request', {
    method: method,
    url: url,
    headers: headers,
    payload: payload
  })["id"]
end

.response(id) ⇒ Object



24
25
26
# File 'lib/machine-gun/commands.rb', line 24

def self.response(id)
  Bridge.command('response', id: id)
end

.startObject



7
8
9
# File 'lib/machine-gun/commands.rb', line 7

def self.start
  Bridge.command('start', { })
end

.stopObject



11
12
13
# File 'lib/machine-gun/commands.rb', line 11

def self.stop
  Bridge.command('stop', { })
end