lib/blather/client/dsl/pubsub.rb in sprsquish-blather-0.4.3 vs lib/blather/client/dsl/pubsub.rb in sprsquish-blather-0.4.4

- old
+ new

@@ -2,11 +2,12 @@ module DSL class PubSub attr_accessor :host - def initialize(host) + def initialize(client, host) + @client = client @host = host end ## # Retrieve Affiliations @@ -118,10 +119,10 @@ end private def request(node, method = nil, callback = nil, &block) block = lambda { |node| callback.call(method ? node.__send__(method) : node) } unless block_given? - DSL.client.write_with_handler(node, &block) + @client.write_with_handler(node, &block) end def send_to(host = nil) raise 'You must provide a host' unless (host ||= @host) host