Class: FluentPath::Expression

Inherits:
Object
  • Object
show all
Defined in:
lib/fhir_models/fluentpath/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/fluentpath/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/fluentpath/expression.rb', line 3

def tree
  @tree
end

Instance Method Details

#cloneObject



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

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

#inspectObject



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

def inspect
  to_s
end

#to_sObject



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

def to_s
  @tree.to_s
end