Class: ActiveFacts::CQL::Compiler::Quantifier
- Inherits:
-
Object
- Object
- ActiveFacts::CQL::Compiler::Quantifier
- Defined in:
- lib/activefacts/cql/compiler/clause.rb
Overview
REVISIT: This needs to handle annotations for some/that/which, etc.
Instance Attribute Summary collapse
-
#context_note ⇒ Object
Returns the value of attribute context_note.
-
#enforcement ⇒ Object
Returns the value of attribute enforcement.
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
Instance Method Summary collapse
-
#initialize(min, max, enforcement = nil, context_note = nil) ⇒ Quantifier
constructor
A new instance of Quantifier.
- #inspect ⇒ Object
- #is_mandatory ⇒ Object
- #is_unique ⇒ Object
- #is_zero ⇒ Object
Constructor Details
#initialize(min, max, enforcement = nil, context_note = nil) ⇒ Quantifier
Returns a new instance of Quantifier.
1102 1103 1104 1105 1106 1107 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1102 def initialize min, max, enforcement = nil, context_note = nil @min = min @max = max @enforcement = enforcement @context_note = context_note end |
Instance Attribute Details
#context_note ⇒ Object
Returns the value of attribute context_note.
1099 1100 1101 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1099 def context_note @context_note end |
#enforcement ⇒ Object
Returns the value of attribute enforcement.
1098 1099 1100 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1098 def enforcement @enforcement end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
1100 1101 1102 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1100 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
1100 1101 1102 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1100 def min @min end |
Instance Method Details
#inspect ⇒ Object
1121 1122 1123 1124 1125 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1121 def inspect "[#{@min}..#{@max}]#{ @context_note && ' ' + @context_note.inspect }" end |
#is_mandatory ⇒ Object
1113 1114 1115 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1113 def is_mandatory @min and @min >= 1 end |
#is_unique ⇒ Object
1109 1110 1111 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1109 def is_unique @max and @max == 1 end |
#is_zero ⇒ Object
1117 1118 1119 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1117 def is_zero @min == 0 and @max == 0 end |