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
Returns the value of attribute max.
-
#min ⇒ Object
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.
1152 1153 1154 1155 1156 1157 1158 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1152 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.
1148 1149 1150 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1148 def context_note @context_note end |
#enforcement ⇒ Object
Returns the value of attribute enforcement.
1147 1148 1149 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1147 def enforcement @enforcement end |
#max ⇒ Object
Returns the value of attribute max.
1150 1151 1152 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1150 def max @max end |
#min ⇒ Object
Returns the value of attribute min.
1150 1151 1152 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1150 def min @min end |
#pragmas ⇒ Object
Returns the value of attribute pragmas.
1149 1150 1151 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1149 def pragmas @pragmas end |
Instance Method Details
#inspect ⇒ Object
1172 1173 1174 1175 1176 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1172 def inspect "[#{@min}..#{@max}]#{ @context_note && ' ' + @context_note.inspect }" end |
#is_mandatory ⇒ Object
1164 1165 1166 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1164 def is_mandatory @min and @min >= 1 end |
#is_unique ⇒ Object
1160 1161 1162 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1160 def is_unique @max and @max == 1 end |
#is_zero ⇒ Object
1168 1169 1170 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1168 def is_zero @min == 0 and @max == 0 end |