Class: VCDOM::XPath::Internal::AbstractValue
- Inherits:
-
Object
- Object
- VCDOM::XPath::Internal::AbstractValue
show all
- Defined in:
- lib/vcdom/xpath/internal/value.rb
Overview
Instance Method Summary
collapse
Instance Method Details
#%(val) ⇒ Object
20
|
# File 'lib/vcdom/xpath/internal/value.rb', line 20
def %( val ); self.to_number_value % val end
|
#*(val) ⇒ Object
18
|
# File 'lib/vcdom/xpath/internal/value.rb', line 18
def *( val ); self.to_number_value * val end
|
#+(val) ⇒ Object
16
|
# File 'lib/vcdom/xpath/internal/value.rb', line 16
def +( val ); self.to_number_value + val end
|
#-(val) ⇒ Object
17
|
# File 'lib/vcdom/xpath/internal/value.rb', line 17
def -( val ); self.to_number_value - val end
|
#-@ ⇒ Object
15
|
# File 'lib/vcdom/xpath/internal/value.rb', line 15
def -@(); - self.to_number_value end
|
#/(val) ⇒ Object
19
|
# File 'lib/vcdom/xpath/internal/value.rb', line 19
def /( val ); self.to_number_value / val end
|
#<=>(val) ⇒ Object
48
49
50
51
52
53
54
|
# File 'lib/vcdom/xpath/internal/value.rb', line 48
def <=>( val )
if val.value_type == :node_set then
return ( val <=> self ) * -1
else
return self.to_number_value.value <=> val.to_number_value.value
end
end
|
#==(val) ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/vcdom/xpath/internal/value.rb', line 26
def ==( val )
types = [ self.value_type, val.value_type ]
if types.include? :boolean then
return val.to_boolean_value.value == self.to_boolean_value.value ? BooleanValue.true : BooleanValue.false
elsif types.include? :node_set then
val == self
elsif types.include? :number
return val.to_number_value.value == self.to_number_value.value ? BooleanValue.true : BooleanValue.false
else
return val.to_string_value.value == self.to_string_value.value ? BooleanValue.true : BooleanValue.false
end
end
|
#is_command? ⇒ Boolean
9
|
# File 'lib/vcdom/xpath/internal/value.rb', line 9
def is_command?; false end
|
#is_expr? ⇒ Boolean
8
|
# File 'lib/vcdom/xpath/internal/value.rb', line 8
def is_expr?; false end
|
#is_value? ⇒ Boolean
7
|
# File 'lib/vcdom/xpath/internal/value.rb', line 7
def is_value?; true end
|
#neq?(val) ⇒ Boolean
40
41
42
43
44
45
46
|
# File 'lib/vcdom/xpath/internal/value.rb', line 40
def neq?( val )
if val.value_type == :node_set then
return val.neq? self
else
return ( self == val ? BooleanValue.false : BooleanValue.true )
end
end
|
#to_s ⇒ Object
11
12
13
|
# File 'lib/vcdom/xpath/internal/value.rb', line 11
def to_s()
"XPathValue(#{value})"
end
|
#|(val) ⇒ Object
22
23
24
|
# File 'lib/vcdom/xpath/internal/value.rb', line 22
def |( val )
raise "User Error : xpath operator \"|\" must operate NodeSet"
end
|