Class: Proc
- Inherits:
-
Object
- Object
- Proc
- Defined in:
- lib/lab42/stream/proc.rb
Instance Method Summary collapse
Instance Method Details
#memoized ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/lab42/stream/proc.rb', line 2 def memoized already_run = false result = nil ->{ if already_run result else already_run = true result = call() end } end |
#not ⇒ Object
15 16 17 18 19 |
# File 'lib/lab42/stream/proc.rb', line 15 def not -> (*args, &blk) { ! self.(*args, &blk) } end |