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.
-
#pragmas ⇒ Object
Returns the value of attribute pragmas.
Instance Method Summary collapse
-
#initialize(min, max, enforcement = nil, context_note = nil, pragmas = 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, pragmas = nil) ⇒ Quantifier
Returns a new instance of Quantifier.
1108 1109 1110 1111 1112 1113 1114 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1108 def initialize min, max, enforcement = nil, context_note = nil, pragmas = nil @min = min @max = max @enforcement = enforcement @context_note = context_note @pragmas = pragmas end |
Instance Attribute Details
#context_note ⇒ Object
Returns the value of attribute context_note.
1104 1105 1106 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1104 def context_note @context_note end |
#enforcement ⇒ Object
Returns the value of attribute enforcement.
1103 1104 1105 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1103 def enforcement @enforcement end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
1106 1107 1108 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1106 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
1106 1107 1108 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1106 def min @min end |
#pragmas ⇒ Object
Returns the value of attribute pragmas.
1105 1106 1107 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1105 def pragmas @pragmas end |
Instance Method Details
#inspect ⇒ Object
1128 1129 1130 1131 1132 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1128 def inspect "[#{@min}..#{@max}]#{ @context_note && ' ' + @context_note.inspect }" end |
#is_mandatory ⇒ Object
1120 1121 1122 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1120 def is_mandatory @min and @min >= 1 end |
#is_unique ⇒ Object
1116 1117 1118 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1116 def is_unique @max and @max == 1 end |
#is_zero ⇒ Object
1124 1125 1126 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1124 def is_zero @min == 0 and @max == 0 end |