Class: Pact::Matchers::V3::Number

Inherits:
Base show all
Defined in:
lib/pact/matchers/v3/number.rb

Instance Attribute Summary

Attributes inherited from Base

#kind, #opts, #spec_version, #template

Instance Method Summary collapse

Methods inherited from Base

#as_basic, #as_plugin

Constructor Details

#initialize(template) ⇒ Number

Returns a new instance of Number.



7
8
9
10
11
12
13
14
# File 'lib/pact/matchers/v3/number.rb', line 7

def initialize(template)
  unless template.is_a?(Numeric)
    raise MatcherInitializationError,
          "#{self.class}: #{template} should be an instance of Numeric"
  end

  super(spec_version: Pact::Matchers::PACT_SPEC_V3, kind: 'number', template: template)
end