text: Dynamically Add Methods to Classes Through their Objects in Ruby
  Playing with the implementation of a new library I am working on called starfish (I will blog about it shortly), I came up with this fun little Ruby hack that makes Ruby seem more like a prototype-based language than it already does.Playing with the implementation of a new library I am working on called starfish (I will blog about it shortly), I came up with this fun little Ruby hack that makes Ruby seem more like a prototype-based language than it already does.
  class Foo
  def method_missing(name, *args)
  if name.to_s =~ /(.*)=$/ && args[0].is_a?(Proc)
  self.class.instance_eval do
  define_method($1, args[0])
  end
  else
  super
  end
  end
  end
  f = Foo.new
  f.greet = lambda {|t| "Hello #{t}!"}
  f.greet "Lucas Carlson" # => Hello Lucas Carlson!
  j = Foo.new
  j.greet "World" # => Hello World!
  Hope you enjoy it as much as I do and I can't wait to show you how I am using it!
  You should follow me on twitter here.
  Technoblog reader special: click here to get $10 off web hosting by FatCow!
  70 Comments:
  What's wrong with require "ostruct" ?
  9:20 AM, August 04, 2006
  OpenStruct is a great library, but does not add arbitrary methods at run time. For example:
  require 'ostruct'
  x = OpenStruct.new
  x.bar = lambda{|x|puts x}
  x.bar(1) # => #Proc:0x013e8b34@(irb):8
  That is not what you would expect, you want it to print out 1.
  10:34 AM, August 04, 2006
  That's pretty cool. As I do not seem to be very imaginative today, could you give an example of where this technique may be useful?
  2:32 PM, August 04, 2006
  I am using it a library I am about to announce, so you will see a great use in a few days.
  2:34 PM, August 04, 2006
  if the only thing is invoking that lambda in a method, just:
  define_method($1,&args.first)
  2:58 PM, August 04, 2006
  oops, I didn't escape the & :|
  3:00 PM, August 04, 2006
  Good point, I have changed that in the code example, thanks.
  4:01 PM, August 04, 2006
  that's fun!
  4:19 AM, August 05, 2006
  hi,
  a really good idea, oh i've just realised that you could call self.class.send to get to the private method rather than use instance_eval, I suppose it's a little bit shorter.
  if name.to_s =~ /(.*)=$/ && args[0].is_a?(Proc)
  self.class.send(:define_method, $1, args[0])
  else
  super
  end
  1:53 AM, August 06, 2006
  I have posted the way I am using this in a new blog post.
  2:07 PM, August 23, 2006
  Really good stuff. Thanks!
  8:57 AM, January 18, 2007
  i buy hydrocodone at buy hydrocodone - can't find any cheaper
  5:48:09
  A good blog. Thanks for sharing the information. It is very useful for my future. keep sharing
  duck life 3 | Slither io |Red Ball 3 |
  red ball 2| gmail sign in| Gmail login|
  3:13 AM, June 22, 2016
  7:26 PM, July 06, 2016
  This is a great article. It gave me a lot of useful information. thank you very |
  9:08 PM, July 28,
  chenlina20161018
  ugg australia
  oakley sunglasses
  coach outlet
  tods shoes
  oklahoma city thunder jerseys
  fitflops uk
  michael kors outlet
  ed hardy clothing
  designer handbags
  coach outlet store online
  7
  longchamp sale
  yeezy shoes
  tods outlet
  coach factory outlet online
  true religion jeans outlet
  michael kors
  ralph lauren
  polo ralph lauren outlet
  kate spade purses
  louis vuitton
  xushengda0418
  6:44 AM, April 18,:21 PM, January 12, 2018
  I enjoy reading a post that can make men and women think. Also, thanks for permitting me to comment! best spy camera app , hidden camera detector app
  9:57 PM, January 29, 2018
  You need to take part in a contest for one of the greatest websites on the internet. I most certainly will recommend this website! pseg customer service ,pseg power outage
  8:43 PM, January 31, 2018
  how to change skins in minecraft pc
  create your minecraft skin
  download your minecraft
  change skins minecraft
  minecraft create your own skins
  3:36 AM, March 10, 2018
  12:02 AM, March 12, 2018
  dogs food
  dogs health
  dogs heat cycle
  dog food
  dog can have it
  9:57 PM, March 19, 2018
  uber customer care chennai
  uber chennai customer care
  know more about here
  uber customer care
  2:08 AM, March 21, 2018
  6:10 PM, March 23, 2018
  I am typically to running a blog and i really admire your content. The article has actually peaks my interest. I am going to bookmark your site and maintain checking for brand new information. I wonder how a lot attempt you place to create this type of wonderful informative web site. Thanks!
  Visit friv 2 online the best free online games
  1:34 AM, March 25, 2018
  11:48 PM, March 29, 2018
  This is a great web site. Good sparkling user interface and very informative blogs. I will be coming back in a bit, thanks for the great article. I found so many interesting stuff in your blog especially its discussion. Thanks!
  here is the friv page if you want to have fun.
  6:52 AM, March 30, 2018
  know more
  can run it
  can my pc run it
  system requirements
  10:43 PM, March 30, 2018
  It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing.
  obat sakit kencing
  obat ginjal bengkak
  obat maag kronis tradisional
  obat pengapuran tulang belakang
  obat tradisional salpingitis
  obat kencing manis
  obat perut begah
  obat tuba falopi tersumbat
  8:27 PM, April 02, 2018
  Hi do check out this latest post with our New Blog Post and I hope you would have enjoyed all our post tylenol dosing for dogs
  1:01 AM, April 03, 2018
  I am happy that you simply shared this helpful information with us. Please stay us informed like this. Thank you for sharing. cara menyembuhkan bronkitis secara alami obat infeksi saluran kencing
  8:51 PM, April 04, 2018
  Your blog posts are more interesting and impressive. I think there are many people like and visit it regularly, including me.I actually appreciate your own position and I will be sure to come back here. flipkart customer care number toll free
  1:45 AM, April 06, 2018
  I am typically to running a blog and i really admire your content. The article has actually peaks my interest. I am going to bookmark your site and maintain checking for brand new information. unblocked games run 3
  4:01 AM, April 17,
  3:29 AM, April 27, 2018
  lebron 14
  jordan 13
  nike free run
  oakley sunglasses for men
  nike free
  air max 2018
  adidas outlet
  10:36 PM, May 18, 2018
  If you have a history of illness that is difficult to recover, maybe our next article will help you to recover
  Suplemen Penambah Nafsu Makan Anak
  Cara Menghilangkan Hemangioma
  Cara Mengatasi Sakit Pada Buah Zakar
  Cara mengobati penyakit Lyme
  Cara Mengobati Radang Telinga
  5:53 PM, May 21, 2018
  moncler outlet
  cheap nba jerseys
  goyard bags
  nike air amx 270
  michael jordan shoes
  michael kors uk
  yeezy 700
  burberry outlet
  adidas outlet
  af1
  1:01 AM, May 26, 2018
  6:03 PM, June 07,
  8:30 PM, June 07, 2018
  michael kors handbags
  coach outlet
  kate spade outlet
  michael kors outlet
  armani exchange
  air max 97
  karen millen dresses
  stussy clothing
  minnetonka outlet
  canada goose coats
  chanyuan2018.06.19
  6:31 PM, June 18, 2018
  anime streaming sites
  watch anime online websites
  best sites watch anime
  best free anime sites
  best site to watch anime
  2:30 AM, July 05, 2018
  new iphone no service
  iphone 6 says no service
  Download Now
  iphone 6 searching for service
  iphone 6 no service
  2:21 AM, July 12, 2018
  zzzzz2018.7.16
  nike shoes
  salomon
  louboutin shoes
  canada goose outlet
  nike huarache femme
  football pas cher
  jordan 4
  ugg boots clearance
  supreme shirt
  prada shoes
  7:03 PM, July 15, 2018
  thank you very useful information admin, and pardon me permission to share articles here may help Cara menyembuhkan asam urat
  12:14 AM, August 06, 2018
  6:54 PM, August 10, 2018
  10:51 PM, August 19, 2018
  Agen Judi Bola Resmi
  Agen Bola Resmi
  1:07 AM, August 24, 2018
  Bismillah Hopefully given the health and sustenance abundant amen :))
  11:36 PM, August 24, 2018
  9:28 PM, August 27,
  What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much obat benjolan di selangkangan paha
  11:49 PM, September 05,:01 AM, September 06, 2018
  thank you very useful information admin, and pardon me permission to share articles here may help Cara mengobati radang panggul
  2:36 AM, September 07, 2018
  11:05 PM, September 12, 2018
  1:36 AM, September 18, 2018
  7:16 PM, September 20, 2018
  7:17 PM, September 20, 2018
  12:38 AM, September 29, 2018
  1:49 AM, October 06, 2018
  9:00 PM, October 09, 2018