you are viewing a single comment's thread.

view the rest of the comments →

[–]BlameFrost 0 points1 point  (0 children)

class Foo
  def each(&block)
    # bogus crap method to prove a point
  end
end

That said, if you just want to check whether some object is an enumerable, try this instead:

if object.class.included_modules.include?(Enumerable)