]> cat aescling's git repositories - mastodon.git/commitdiff
Make use of the regex attr_reader. #164.
authorDavid Yip <yipdw@member.fsf.org>
Sun, 15 Oct 2017 01:45:14 +0000 (20:45 -0500)
committerDavid Yip <yipdw@member.fsf.org>
Sat, 21 Oct 2017 19:54:36 +0000 (14:54 -0500)
It would also have been valid to get rid of the attr_reader, but I like
being able to reach inside KeywordMute::Matcher without resorting to
instance_variable_get tomfoolery.

app/models/keyword_mute.rb

index d80fcaa60f581ea8ce617601bcc3411f885c2b61..e1a8c3712c53d1a88f1de0d747965d54989f2d6a 100644 (file)
@@ -38,7 +38,7 @@ class KeywordMute < ApplicationRecord
     end
 
     def =~(str)
-      @regex ? @regex =~ str : false
+      regex ? regex =~ str : false
     end
   end
 end
This page took 0.020935 seconds and 3 git commands to generate.