Class: Object

Inherits:
BasicObject
Defined in:
lib/rltk/util/monkeys.rb

Overview

Monkey-patched Object class.

Instance Method Summary collapse

Instance Method Details

#returning(value) {|value| ... } ⇒ Object

Simple implementation of the Y combinator.

Parameters:

  • value (Object)

    Value to be returned after executing the provided block.

Yields:

  • (value)

Returns:

  • (Object)

    The object passed in parameter value.



73
74
75
76
# File 'lib/rltk/util/monkeys.rb', line 73

def returning(value)
	yield(value)
	value
end