Class: OpenEHR::AQL::Model::PathPart
- Inherits:
-
Object
- Object
- OpenEHR::AQL::Model::PathPart
- Defined in:
- lib/openehr/aql/model/object_path.rb
Overview
pathPart : IDENTIFIER pathPredicate? ;
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#predicate ⇒ Object
readonly
Returns the value of attribute predicate.
Instance Method Summary collapse
-
#initialize(attribute:, predicate: nil) ⇒ PathPart
constructor
A new instance of PathPart.
- #to_s ⇒ Object
Constructor Details
#initialize(attribute:, predicate: nil) ⇒ PathPart
Returns a new instance of PathPart.
22 23 24 25 26 |
# File 'lib/openehr/aql/model/object_path.rb', line 22 def initialize(attribute:, predicate: nil) @attribute = attribute @predicate = predicate freeze end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
20 21 22 |
# File 'lib/openehr/aql/model/object_path.rb', line 20 def attribute @attribute end |
#predicate ⇒ Object (readonly)
Returns the value of attribute predicate.
20 21 22 |
# File 'lib/openehr/aql/model/object_path.rb', line 20 def predicate @predicate end |
Instance Method Details
#to_s ⇒ Object
28 29 30 |
# File 'lib/openehr/aql/model/object_path.rb', line 28 def to_s predicate ? "#{attribute}[#{predicate}]" : attribute end |