Class: Mocktail::Matchers::Numeric

Inherits:
Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/mocktail/matchers/numeric.rb,
lib/mocktail/sorbet/mocktail/matchers/numeric.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#is_mocktail_matcher?

Constructor Details

#initializeNumeric

Returns a new instance of Numeric.



9
10
11
# File 'lib/mocktail/matchers/numeric.rb', line 9

def initialize
  # Empty initialize is necessary b/c Base default expects an argument
end

Class Method Details

.matcher_nameObject



5
6
7
# File 'lib/mocktail/matchers/numeric.rb', line 5

def self.matcher_name
  :numeric
end

Instance Method Details

#inspectObject



17
18
19
# File 'lib/mocktail/matchers/numeric.rb', line 17

def inspect
  "numeric"
end

#match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/mocktail/matchers/numeric.rb', line 13

def match?(actual)
  actual.is_a?(::Numeric)
end