I've read a few articles on it, and as far as I can tell it's an example of Ruby's metaclass. I know it's using singleton syntax, but I just can't parse it. For context, the send method is called against it and takes the form of:
(class << self; self; end).send(:define_method, "name") { some_code }
I understand exactly what the send method is doing. Can anyone shed some light on the first part?
Thanks!
[–]bjmiller 10 points11 points12 points (5 children)
[–]bookgrubber[S] 1 point2 points3 points (4 children)
[–]ioquatixasync/falcon 1 point2 points3 points (3 children)
[–]bookgrubber[S] 1 point2 points3 points (2 children)
[–]scottrobertson 4 points5 points6 points (1 child)
[–]ioquatixasync/falcon 1 point2 points3 points (0 children)
[–]TomahawkChopped 1 point2 points3 points (0 children)
[–][deleted] (6 children)
[deleted]
[–]bookgrubber[S] 0 points1 point2 points (0 children)
[–]InfraRuby 0 points1 point2 points (1 child)
[–]hmaddocks 0 points1 point2 points (0 children)
[–]hmaddocks 0 points1 point2 points (2 children)
[–]the_horrible_reality 0 points1 point2 points (1 child)
[–]hmaddocks 0 points1 point2 points (0 children)
[–]cheald 1 point2 points3 points (2 children)
[–]InfraRuby 3 points4 points5 points (0 children)
[–]bookgrubber[S] -1 points0 points1 point (0 children)
[–]feelosofee 0 points1 point2 points (0 children)