Class: KDE::MimeType
Instance Method Summary collapse
-
#=~(str) ⇒ Object
Compares self with the string str.
Instance Method Details
#=~(str) ⇒ Object
Compares self with the string str. The comparison works as follows:
-
if str doesn’t start with
!
or=
, it works asKDE::MimeType#is
-
if str starts with
!
, returns the oppsite ofKDE::MimeType#is
-
if str starts with
=
, makes an exact match between str andself.name
-
if str starts with
!=
or=!
, makes an exact match and inverts it
239 240 241 242 243 244 245 246 247 |
# File 'lib/ruber/kde_sugar.rb', line 239 def =~ str str = str.sub(/^([!=]{0,2})/, '') case $1 when '!' then !(self.is str) when '=' then self.name == str when '!=', '=!' then !(self.name == str) else self.is str end end |