Class: Sbmt::Pact::Matchers::V2::Type

Inherits:
Base
  • Object
show all
Defined in:
lib/sbmt/pact/matchers/v2/type.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) ⇒ Type

Returns a new instance of Type.



8
9
10
11
12
# File 'lib/sbmt/pact/matchers/v2/type.rb', line 8

def initialize(template)
  raise MatcherInitializationError, "#{self.class}: template is not a primitive" unless template.is_a?(TrueClass) || template.is_a?(FalseClass) || template.is_a?(Numeric) || template.is_a?(String)

  super(spec_version: Sbmt::Pact::Matchers::PACT_SPEC_V2, kind: "type", template: template)
end