Class: Class

Inherits:
Object show all
Defined in:
lib/is_same/core_ext/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#matching?(object = nil, &block) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/is_same/core_ext/core_ext.rb', line 13

def matching? object=nil, &block
  case object
  when String
    object == self.name 
  when Symbol
    object == self.name.to_sym
  when Regexp
    !!object.match(self.name)
  else
    super
  end
end