Skip to content

Instantly share code, notes, and snippets.

@llimllib
Created February 7, 2013 03:23
Show Gist options
  • Save llimllib/4728143 to your computer and use it in GitHub Desktop.
Save llimllib/4728143 to your computer and use it in GitHub Desktop.
classdef.app_method("""
def each
unless self.begin.is_a? Integer
raise TypeError, "can't iterate from Float"
end
i = self.begin
lim = self.end
lim += 0.1 unless self.exclude_end?
while i < lim
yield i
i += 1
end
end
""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment