Module: Fix::Requirement Private

Included in:
Dsl
Defined in:
lib/fix/requirement.rb

Overview

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

Collection of expectation matchers.

Instance Method Summary collapse

Instance Method Details

#MAY(matcher) ⇒ Requirement::Optional

This method mean that an item is truly optional. One vendor may choose to include the item because a particular marketplace requires it or because the vendor feels that it enhances the product while another vendor may omit the same item. An implementation which does not include a particular option must be prepared to interoperate with another implementation which does include the option, though perhaps with reduced functionality. In the same vein an implementation which does include a particular option must be prepared to interoperate with another implementation which does not include the option (except, of course, for the feature the option provides).

Parameters:

  • matcher (#matches?)

    The matcher.

Returns:

  • (Requirement::Optional)

    An optional requirement level instance.



81
82
83
# File 'lib/fix/requirement.rb', line 81

def MAY(matcher)
  ::Spectus::Requirement::Optional.new(negate: false, matcher:)
end

#MUST(matcher) ⇒ Requirement::Required

This method mean that the definition is an absolute requirement of the specification.

Parameters:

  • matcher (#matches?)

    The matcher.

Returns:

  • (Requirement::Required)

    An absolute requirement level instance.



22
23
24
# File 'lib/fix/requirement.rb', line 22

def MUST(matcher)
  ::Spectus::Requirement::Required.new(negate: false, matcher:)
end

#MUST_NOT(matcher) ⇒ Requirement::Required

This method mean that the definition is an absolute prohibition of the specification.

Parameters:

  • matcher (#matches?)

    The matcher.

Returns:

  • (Requirement::Required)

    An absolute prohibition level instance.



33
34
35
# File 'lib/fix/requirement.rb', line 33

def MUST_NOT(matcher)
  ::Spectus::Requirement::Required.new(negate: true, matcher:)
end

#SHOULD(matcher) ⇒ Requirement::Recommended

This method mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.

Parameters:

  • matcher (#matches?)

    The matcher.

Returns:

  • (Requirement::Recommended)

    A recommended requirement level instance.



46
47
48
# File 'lib/fix/requirement.rb', line 46

def SHOULD(matcher)
  ::Spectus::Requirement::Recommended.new(negate: false, matcher:)
end

#SHOULD_NOT(matcher) ⇒ Requirement::Recommended

This method mean that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label.

Parameters:

  • matcher (#matches?)

    The matcher.

Returns:

  • (Requirement::Recommended)

    A not recommended requirement level instance.



61
62
63
# File 'lib/fix/requirement.rb', line 61

def SHOULD_NOT(matcher)
  ::Spectus::Requirement::Recommended.new(negate: true, matcher:)
end