fingernails in oatmeal, Metaprogramming: Ruby vs. Javascript - 0 views
-
drew['battleCry']();
-
What we want is the ability to define a method dynamically (given a name) that is also a closure over the lexical scope at the point of method definition.
-
color_name = 'black' Ninja.send(:define_method, 'color') do puts "#{name}'s color is #{color_name}"end
- ...5 more annotations...