Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixes the class-level Exchange default initialization #211

Merged
merged 1 commit into from
May 11, 2014

Conversation

litch
Copy link
Contributor

@litch litch commented May 10, 2014

I was trying to use the class-level Exchange default method but it was raising out because that compatibility module was included (not extended). Rather than also include the module, I just pass the channel_or_connection down to the instance without coercion.

> Bunny::Exchange.default(channel).publish("make clean", routing_key => "tasks")
NoMethodError: undefined method `channel_from' for Bunny::Exchange:Class
    from /Users/litch/.rvm/gems/ruby-2.1.1/gems/bunny-1.2.1/lib/bunny/exchange.rb:58:in `default'
    from (irb):9
    from /Users/litch/.rvm/rubies/ruby-2.1.1/bin/irb:11:in `<main>'

@michaelklishin
Copy link
Member

I doubt this API part has much use but thanks nonetheless!

michaelklishin added a commit that referenced this pull request May 11, 2014
Fixes the class-level Exchange default initialization
@michaelklishin michaelklishin merged commit a820fd4 into ruby-amqp:master May 11, 2014
@litch
Copy link
Contributor Author

litch commented May 12, 2014

Yeah, I figured it hadn't been used, since it looks like it had been broken for about a year, but I thought I might as well fix it. =)

Great project!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants