4 ms·
The poingant guide link (implimentation of the "belongs_to" class function) is a string of redirects. Anyone have a copy of the original?
by RangerScience 10y ago
The poingant guide link (implimentation of the "belongs_to" class function) is a string of redirects. Anyone have a copy of the original?
- pdkl95 10y agohttp://poignant.guide/book/chapter-6.html#section3 http://poignant.guide/book/chapter-6.html#section3 edit: While I love _why's guide, which can be very useful for learning ruby metaprogramming (and ruby in general), the technique presented there is a bit outdated. Modern ruby doesn't require such an "ugly" style because we now have Object#define_singleton_method[1] as a way of defining class level methods. There shouldn't be a need to use #instance_eval to define methods in the metaclass. [1] https://ruby-doc.org/core-2.2.2/Object.html#method-i-define_singleton_method https://ruby-doc.org/core-2.2.2/Object.html#method-i-define_...