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.


141
142
143
144
145
146
147
# File 'lib/fix/requirement.rb', line 141

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

#MAY!(matcher) ⇒ Object

See Also:


152
153
154
155
156
157
158
# File 'lib/fix/requirement.rb', line 152

def MAY!(matcher)
  ::Spectus::Requirement::Optional.new(
    isolate: true,
    negate:  false,
    matcher: 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
25
26
27
28
# File 'lib/fix/requirement.rb', line 22

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

#MUST!(matcher) ⇒ Object

See Also:


33
34
35
36
37
38
39
# File 'lib/fix/requirement.rb', line 33

def MUST!(matcher)
  ::Spectus::Requirement::Required.new(
    isolate: true,
    negate:  false,
    matcher: 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.


48
49
50
51
52
53
54
# File 'lib/fix/requirement.rb', line 48

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

#MUST_NOT!(matcher) ⇒ Object

See Also:


59
60
61
62
63
64
65
# File 'lib/fix/requirement.rb', line 59

def MUST_NOT!(matcher)
  ::Spectus::Requirement::Required.new(
    isolate: true,
    negate:  true,
    matcher: 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.


76
77
78
79
80
81
82
# File 'lib/fix/requirement.rb', line 76

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

#SHOULD!(matcher) ⇒ Object

See Also:


87
88
89
90
91
92
93
# File 'lib/fix/requirement.rb', line 87

def SHOULD!(matcher)
  ::Spectus::Requirement::Recommended.new(
    isolate: true,
    negate:  false,
    matcher: 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.


106
107
108
109
110
111
112
# File 'lib/fix/requirement.rb', line 106

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

#SHOULD_NOT!(matcher) ⇒ Object

See Also:


117
118
119
120
121
122
123
# File 'lib/fix/requirement.rb', line 117

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