Skip to content

Instantly share code, notes, and snippets.

@jfirebaugh
Created April 24, 2012 22:59
Show Gist options
  • Select an option

  • Save jfirebaugh/2484455 to your computer and use it in GitHub Desktop.

Select an option

Save jfirebaugh/2484455 to your computer and use it in GitHub Desktop.
diff --git a/kernel/bootstrap/channel.rb b/kernel/bootstrap/channel.rb
index 14a7556..7ac9bad 100644
--- a/kernel/bootstrap/channel.rb
+++ b/kernel/bootstrap/channel.rb
@@ -73,36 +73,5 @@ module Rubinius
Rubinius.primitive :channel_try_receive
raise PrimitiveFailure, "Channel#try_receive primitive failed"
end
-
- ##
- # Converts +obj+ into a Channel using #to_channel.
-
- def self.convert_to_channel(obj)
- return obj if Channel === obj
- begin
- o2 = obj.to_channel
- unless Channel === o2
- raise ArgumentError, "to_channel on #{obj.inspect} did not return a Channel"
- end
- return o2
- rescue NoMethodError
- raise ArgumentError, "Unable to convert #{obj.inspect} into a channel"
- end
- end
-
- ##
- # Legacy API. To be removed.
-
- def self.receive(obj) # :nodoc:
- return convert_to_channel(obj).receive
- end
-
- ##
- # API compliance, returns self.
-
- def to_channel
- self
- end
-
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment