Class: StompServer::StompId
- Inherits:
-
Object
- Object
- StompServer::StompId
- Defined in:
- lib/stomp_server/stomp_id.rb
Instance Method Summary collapse
- #[](id) ⇒ Object
-
#initialize ⇒ StompId
constructor
A new instance of StompId.
Constructor Details
#initialize ⇒ StompId
Returns a new instance of StompId.
12 13 14 |
# File 'lib/stomp_server/stomp_id.rb', line 12 def initialize @host = Socket.gethostname.to_s end |
Instance Method Details
#[](id) ⇒ Object
16 17 18 19 |
# File 'lib/stomp_server/stomp_id.rb', line 16 def [](id) msgid = sprintf("%.6f",Time.now.to_f).to_s.sub('.','-') msgid = @host + '-' + msgid + '-' + id.to_s end |