Class: FluentPath::Expression

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tree) ⇒ Expression

Returns a new instance of Expression.



6
7
8
# File 'lib/fluentpath/expression.rb', line 6

def initialize(tree)
  @tree = tree
end

Instance Attribute Details

#treeObject

Returns the value of attribute tree.



4
5
6
# File 'lib/fluentpath/expression.rb', line 4

def tree
  @tree
end

Instance Method Details

#cloneObject



18
19
20
21
# File 'lib/fluentpath/expression.rb', line 18

def clone
  clone_tree = @tree.map{|x|x.clone rescue x}      
  FluentPath::Expression.new(clone_tree)
end

#inspectObject



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

def inspect
  to_s
end

#to_sObject



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

def to_s
  "#{@tree}"
end