Skip to content

Commit

Permalink
Cleared up docs of the BasicObject coercion guard.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yorick Peterse committed Jun 30, 2014
1 parent 87c2b85 commit d765183
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions kernel/common/type.rb
Expand Up @@ -47,10 +47,18 @@ def self.coerce_to_type_error(original, converted, method, klass)
end

##
# BasicObject responds to pretty much no, if any methods at all. This
# method provides a simple coercion guard for BasicObject instances.
# BasicObject responds to only a select few of methods such as `==` and
# `__send__`. It however does not respond to other methods such as `class`,
# `respond_to?` and other common methods.
#
# Basic example:
# This method provides a guard for code that can not handle BasicObject
# instances. The guard itself is quite simple: it simply raises for
# BasicObject instances.
#
# The first argument is the object to check, the second argument the class
# name that the object would normally be converted into.
#
# Basic usage example:
#
# object = BasicObject.new
#
Expand Down

0 comments on commit d765183

Please sign in to comment.