Class: OpenEHR::AM::Archetype::ConstraintModel::Cardinality
- Inherits:
-
Object
- Object
- OpenEHR::AM::Archetype::ConstraintModel::Cardinality
- Defined in:
- lib/open_ehr/am/archetype/constraint_model.rb
Instance Attribute Summary collapse
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#is_ordered ⇒ Object
Returns the value of attribute is_ordered.
-
#is_unique ⇒ Object
Returns the value of attribute is_unique.
Instance Method Summary collapse
-
#initialize(args = { }) ⇒ Cardinality
constructor
A new instance of Cardinality.
- #is_bag? ⇒ Boolean (also: #bag?)
- #is_list? ⇒ Boolean (also: #list?)
- #is_ordered? ⇒ Boolean (also: #ordered?)
- #is_set? ⇒ Boolean (also: #set?)
- #is_unique? ⇒ Boolean (also: #unique?)
Constructor Details
#initialize(args = { }) ⇒ Cardinality
Returns a new instance of Cardinality.
51 52 53 54 55 |
# File 'lib/open_ehr/am/archetype/constraint_model.rb', line 51 def initialize(args = { }) @interval = args[:interval] @is_ordered = args[:is_ordered] @is_unique = args[:is_unique] end |
Instance Attribute Details
#interval ⇒ Object
Returns the value of attribute interval.
49 50 51 |
# File 'lib/open_ehr/am/archetype/constraint_model.rb', line 49 def interval @interval end |
#is_ordered ⇒ Object
Returns the value of attribute is_ordered.
49 50 51 |
# File 'lib/open_ehr/am/archetype/constraint_model.rb', line 49 def is_ordered @is_ordered end |
#is_unique ⇒ Object
Returns the value of attribute is_unique.
49 50 51 |
# File 'lib/open_ehr/am/archetype/constraint_model.rb', line 49 def is_unique @is_unique end |
Instance Method Details
#is_bag? ⇒ Boolean Also known as: bag?
81 82 83 |
# File 'lib/open_ehr/am/archetype/constraint_model.rb', line 81 def is_bag? return !@is_ordered && !@is_unique end |
#is_list? ⇒ Boolean Also known as: list?
75 76 77 |
# File 'lib/open_ehr/am/archetype/constraint_model.rb', line 75 def is_list? return @is_ordered && !@is_unique end |
#is_ordered? ⇒ Boolean Also known as: ordered?
57 58 59 |
# File 'lib/open_ehr/am/archetype/constraint_model.rb', line 57 def is_ordered? return @is_ordered end |
#is_set? ⇒ Boolean Also known as: set?
69 70 71 |
# File 'lib/open_ehr/am/archetype/constraint_model.rb', line 69 def is_set? return !@is_ordered && @is_unique end |
#is_unique? ⇒ Boolean Also known as: unique?
63 64 65 |
# File 'lib/open_ehr/am/archetype/constraint_model.rb', line 63 def is_unique? return @is_unique end |