Class: Ludy::Rambda
- Inherits:
-
Object
- Object
- Ludy::Rambda
- Defined in:
- lib/ludy/deprecated/rambda.rb
Instance Attribute Summary collapse
-
#this ⇒ Object
(also: #to_proc)
readonly
Returns the value of attribute this.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Rambda
constructor
A new instance of Rambda.
Constructor Details
#initialize(&block) ⇒ Rambda
Returns a new instance of Rambda.
10 11 12 13 14 |
# File 'lib/ludy/deprecated/rambda.rb', line 10 def initialize &block @this = eval block.to_ruby define_instance_method :call, &@this alias_instance_method :[], :call end |
Instance Attribute Details
#this ⇒ Object (readonly) Also known as: to_proc
Returns the value of attribute this.
15 16 17 |
# File 'lib/ludy/deprecated/rambda.rb', line 15 def this @this end |