Permalink
Browse files

change transport config setter methods into attr= style methods

  • Loading branch information...
1 parent 8c48cfc commit b9395e7d3fdf4383edd76f99cca96fd81f2354a4 @zdzolton zdzolton committed Dec 14, 2011
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/push/transport.rb
  2. +2 −2 spec/lib/push/transport_spec.rb
View
@@ -59,15 +59,15 @@ def timeout
@timeout || Timeout
end
- def set_consumer(&block)
+ def consumer=(block)
@consumer = block
end
def consumer env
(@consumer || Consumer).call env
end
- def set_channel(&block)
+ def channel=(block)
@channel = block
end
@@ -5,8 +5,8 @@
before(:all) do
@dispatcher = Push::Transport::Dispatcher.new do |config|
config.timeout = 4
- config.set_consumer {|env| Push::Consumer.new(env['HTTP_FOO'])}
- config.set_channel {|env| env['HTTP_BAR']}
+ config.consumer = Proc.new {|env| Push::Consumer.new(env['HTTP_FOO'])}
+ config.channel = Proc.new {|env| env['HTTP_BAR']}
end
end

0 comments on commit b9395e7

Please sign in to comment.