Class: FHIRPath::Expression

Inherits:
Object
  • Object
show all
Defined in:
lib/fhir_models/fhirpath/expression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tree) ⇒ Expression

Returns a new instance of Expression.



5
6
7
# File 'lib/fhir_models/fhirpath/expression.rb', line 5

def initialize(tree)
  @tree = tree
end

Instance Attribute Details

#treeObject

Returns the value of attribute tree.



3
4
5
# File 'lib/fhir_models/fhirpath/expression.rb', line 3

def tree
  @tree
end

Instance Method Details

#cloneObject



17
18
19
20
21
22
23
24
25
# File 'lib/fhir_models/fhirpath/expression.rb', line 17

def clone
  clone_tree = @tree.map do |x|
    x.clone
  rescue StandardError
    # TODO: This appears to be dead code
    x
  end
  FHIRPath::Expression.new(clone_tree)
end

#inspectObject



13
14
15
# File 'lib/fhir_models/fhirpath/expression.rb', line 13

def inspect
  to_s
end

#to_sObject



9
10
11
# File 'lib/fhir_models/fhirpath/expression.rb', line 9

def to_s
  @tree.to_s
end