Class: SPSPub

Inherits:
Object
  • Object
show all
Defined in:
lib/sps-pub.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address: 'sps', port: '59000') ⇒ SPSPub

Returns a new instance of SPSPub.



10
11
12
# File 'lib/sps-pub.rb', line 10

def initialize(address: 'sps', port: '59000')
  @client = Net::WS.new "ws://%s:%s/" % [address, port]
end

Class Method Details

.notice(s, address: 'sps', port: '59000') ⇒ Object



20
21
22
23
24
# File 'lib/sps-pub.rb', line 20

def self.notice(s, address: 'sps', port: '59000')

  client = Net::WS.new "ws://%s:%s/" % [address, port]
  client.send s
end

.pub(s, address: 'sps', port: '59000') ⇒ Object



26
27
28
# File 'lib/sps-pub.rb', line 26

def self.pub(s, address: 'sps', port: '59000')
  self.notice(s, address: 'sps', port: '59000')
end

.publish(s, address: 'sps', port: '59000') ⇒ Object



30
31
32
# File 'lib/sps-pub.rb', line 30

def self.publish(s, address: 'sps', port: '59000')
  self.notice(s, address: 'sps', port: '59000')
end

Instance Method Details

#notice(s) ⇒ Object



14
15
16
# File 'lib/sps-pub.rb', line 14

def notice(s)
  @client.send s
end

#publishObject



18
19
20
# File 'lib/sps-pub.rb', line 18

def notice(s)
  @client.send s
end