Class: Ludy::Rambda

Inherits:
Object
  • Object
show all
Defined in:
lib/ludy/deprecated/rambda.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#thisObject (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