Class: Vanguard::Matcher::Nullary::Primitive

Inherits:
Vanguard::Matcher::Nullary show all
Defined in:
lib/vanguard/matcher/nullary/primitive.rb

Overview

Matcher that matches primitive types

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#primitiveClass (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return primitive

Returns:

  • (Class)

    primitive



15
16
17
# File 'lib/vanguard/matcher/nullary/primitive.rb', line 15

def primitive
  @primitive
end

Instance Method Details

#matches?(value) ⇒ true, false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if value is kind of primitive

Returns:

  • (true)

    if value is kind of primitive

  • (false)

    otherwise



27
28
29
# File 'lib/vanguard/matcher/nullary/primitive.rb', line 27

def matches?(value)
  value.kind_of?(primitive)
end