Class: ActiveFacts::CQL::Compiler::Quantifier
- Inherits:
-
Object
- Object
- ActiveFacts::CQL::Compiler::Quantifier
- Defined in:
- lib/activefacts/cql/compiler/clause.rb
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.
1049 1050 1051 1052 1053 1054 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1049 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.
1046 1047 1048 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1046 def context_note @context_note end |
#enforcement ⇒ Object
Returns the value of attribute enforcement.
1045 1046 1047 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1045 def enforcement @enforcement end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
1047 1048 1049 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1047 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
1047 1048 1049 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1047 def min @min end |
Instance Method Details
#inspect ⇒ Object
1068 1069 1070 1071 1072 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1068 def inspect "[#{@min}..#{@max}]#{ @context_note && ' ' + @context_note.inspect }" end |
#is_mandatory ⇒ Object
1060 1061 1062 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1060 def is_mandatory @min and @min >= 1 end |
#is_unique ⇒ Object
1056 1057 1058 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1056 def is_unique @max and @max == 1 end |
#is_zero ⇒ Object
1064 1065 1066 |
# File 'lib/activefacts/cql/compiler/clause.rb', line 1064 def is_zero @min == 0 and @max == 0 end |