[openstreetmap/openstreetmap-website] Increase tag2link item leniency (PR #6470)

Pablo Brasero notifications at github.com
Wed Oct 29 10:42:35 UTC 2025


@pablobm commented on this pull request.



> @@ -0,0 +1,57 @@
+# frozen_string_literal: true
+
+module Tag2link
+  class << self

Yeah, long story but `private` doesn't apply to singleton methods, which is what those `def self.method_name` do and allows us to get class methods. The `class << self` thing is common in this type of function-wrapper modules, but I agree it may not be appropriate in a project like this one, where we want to encourage contributions from non-Rubyists.

A slight improvement would be to do `private_class_method def self.choose_best_item(items)`, all in one line, which avoids splitting this declaration into two lines.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6470#discussion_r2472501848
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6470/review/3392671668 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251029/6c8adab5/attachment-0001.htm>


More information about the rails-dev mailing list