Class: OpenEHR::AQL::Model::PathPart

Inherits:
Object
  • Object
show all
Defined in:
lib/openehr/aql/model/object_path.rb

Overview

pathPart : IDENTIFIER pathPredicate? ;

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributeObject (readonly)

Returns the value of attribute attribute.



20
21
22
# File 'lib/openehr/aql/model/object_path.rb', line 20

def attribute
  @attribute
end

#predicateObject (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_sObject



28
29
30
# File 'lib/openehr/aql/model/object_path.rb', line 28

def to_s
  predicate ? "#{attribute}[#{predicate}]" : attribute
end