Class: Symbol

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

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


3
4
5
6
7
8
9
10
11
12
# File 'lib/is_same/core_ext/symbol.rb', line 3

def matching?(object=nil, &block)
  case object
  when Class, Numeric, String
    self == :"#{object}"
  when Regexp
    !!object.match(self.to_s)
	else
    super
  end
end