Skip to content

Instantly share code, notes, and snippets.

@0x0dea
Created July 19, 2015 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0x0dea/7d288ea71387856b4330 to your computer and use it in GitHub Desktop.
Save 0x0dea/7d288ea71387856b4330 to your computer and use it in GitHub Desktop.
foo = (1..Float::INFINITY).lazy
Introspectable.instance_variable_get(foo, 'method') # => false
Introspectable.instance_variable_get(foo, 'arguments') # => nil
foo = foo.select(&:even?)
Introspectable.instance_variable_get(foo, 'method') # => :select
Introspectable.instance_variable_get(foo, 'arguments') # => false (!)
foo = foo.take(10)
Introspectable.instance_variable_get(foo, 'method') # => :take
Introspectable.instance_variable_get(foo, 'arguments') # => [10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment