Class: SPSPub
- Inherits:
-
Object
- Object
- SPSPub
- Defined in:
- lib/sps-pub.rb
Class Method Summary collapse
- .notice(s, address: 'sps', port: '59000') ⇒ Object
- .pub(s, address: 'sps', port: '59000') ⇒ Object
- .publish(s, address: 'sps', port: '59000') ⇒ Object
Instance Method Summary collapse
-
#initialize(address: 'sps', port: '59000') ⇒ SPSPub
constructor
A new instance of SPSPub.
- #notice(s) ⇒ Object
- #publish ⇒ Object
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 |
#publish ⇒ Object
18 19 20 |
# File 'lib/sps-pub.rb', line 18 def notice(s) @client.send s end |