class PIM::NodeValue
Attributes
attributes[RW]
value[R]
Public Class Methods
new(value)
click to toggle source
# File pim.rb, line 2167 def initialize(value) @value = value @attributes = {} end
Public Instance Methods
!()
click to toggle source
# File pim.rb, line 2202 def ! assimilate(false) == false end
!=(other)
click to toggle source
# File pim.rb, line 2177 def !=(other) other = other.value if other.is_a?(NodeValue) assimilate(other) != other end
*(other)
click to toggle source
# File pim.rb, line 2206 def *(other) other = other.value if other.is_a?(NodeValue) assimilate(other) * other end
+(other)
click to toggle source
# File pim.rb, line 2211 def +(other) other = other.value if other.is_a?(NodeValue) assimilate(other) + other end
<(other)
click to toggle source
# File pim.rb, line 2192 def <(other) other = other.value if other.is_a?(NodeValue) assimilate(other) < other end
<=(other)
click to toggle source
# File pim.rb, line 2197 def <=(other) other = other.value if other.is_a?(NodeValue) assimilate(other) <= other end
==(other)
click to toggle source
# File pim.rb, line 2172 def ==(other) other = other.value if other.is_a?(NodeValue) assimilate(other) == other end
>(other)
click to toggle source
# File pim.rb, line 2182 def >(other) other = other.value if other.is_a?(NodeValue) assimilate(other) > other end
>=(other)
click to toggle source
# File pim.rb, line 2187 def >=(other) other = other.value if other.is_a?(NodeValue) assimilate(other) >= other end
[](key)
click to toggle source
# File pim.rb, line 2258 def [](key) @attributes["#{key}"] end
assimilate(other)
click to toggle source
# File pim.rb, line 2216 def assimilate(other) case other when Integer value.to_i when Float value.to_f when FalseClass, TrueClass not ['', 'false'].include?(value.to_s.downcase) when Date Date.parse(value) when DateTime DateTime.parse(value) else case value when 'true' true when 'false' false when nil value else value.to_s end end end
fetch(key, other)
click to toggle source
# File pim.rb, line 2262 def fetch(key, other) @attributes.fetch(key, other) end
nil?()
click to toggle source
# File pim.rb, line 2266 def nil? value == nil end
to_date()
click to toggle source
# File pim.rb, line 2254 def to_date Date.parse(value) end
to_f()
click to toggle source
# File pim.rb, line 2250 def to_f value.to_f end
to_i()
click to toggle source
# File pim.rb, line 2246 def to_i value.to_i end
to_json()
click to toggle source
# File pim.rb, line 2270 def to_json value.to_json end
to_s()
click to toggle source
# File pim.rb, line 2242 def to_s value end