-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change order of parameters on Observable.while #52
Comments
It seems like: IMHO, change the method name to something for ruby way. |
How about yield_while instead? |
We can accept block without changing parameter order --- a/lib/rx/linq/observable/while.rb
+++ b/lib/rx/linq/observable/while.rb
@@ -1,6 +1,13 @@
module RX
class <<Observable
- def while(condition, source)
+ def while(condition_or_source, source = nil)
+ if block_given?
+ condition = Proc.new
+ source = condition_or_source
+ else
+ condition = condition_or_source
+ end
+
enum = Enumerator.new {|y|
while condition.call
y << source We have many time considering it |
Hmm. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jca02266 should we change the order of the parameter on #while so that we could use a block instead?
The text was updated successfully, but these errors were encountered: