StompMq 0.2 → 0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/stompmq/connection.rb +8 -5
  2. metadata +2 -2
@@ -26,16 +26,19 @@ module StompMq
26
26
  end
27
27
 
28
28
  # Subscribe to a STOMP queue.
29
- def subscribe(opts = { :queue => nil })
30
- queue = opts[:queue]
31
- send_frame :subscribe, {:destination => queue}
29
+ def subscribe(opts = { :queue => nil, :selector => nil })
30
+ if opts[:selector]
31
+ send_frame :subscribe, {:destination => opts[:queue], :selector => opts[:selector]}
32
+ else
33
+ send_frame :subscribe, {:destination => opts[:queue]}
34
+ end
32
35
  end
33
36
 
34
37
  # Send a STOMP message to a queue.
35
38
  def send_message(opts = { :queue => nil, :header => {}, :content => {} })
36
39
  queue = opts[:queue]
37
- content = opts[:content]
38
- header = opts[:header]
40
+ content = opts[:content] || {}
41
+ header = opts[:header] || {}
39
42
 
40
43
  header = {:destination => queue}.merge(header)
41
44
  send_frame :send, header, content
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: StompMq
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.2"
4
+ version: "0.3"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sarah Nordstrom
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-06 00:00:00 -04:00
12
+ date: 2008-09-07 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15