lib/om/xml/dynamic_node.rb in om-3.0.4 vs lib/om/xml/dynamic_node.rb in om-3.0.5

- old
+ new

@@ -42,19 +42,23 @@ if /=$/.match(name.to_s) new_update_node(name, args) elsif args.length > 1 new_update_node_with_index(name, args) else - child = term_child_by_name(term.nil? ? parent.term : term, name) + child = term_child_by_name(term.nil? ? parent.term : term, name) if child OM::XML::DynamicNode.new(name, args.first, @document, child, self) else val.send(name, *args, &block) end end end + def respond_to?(method) + super || val.respond_to?(method) + end + def new_update_node(name, args) modified_name = name.to_s.chop.to_sym child = term.retrieve_term(modified_name) node = OM::XML::DynamicNode.new(modified_name, nil, @document, child, self) node.val=args @@ -95,10 +99,12 @@ else term.retrieve_term(name) end end + # This resolves the target of this dynamic node into a reified Array + # @return [Array] def val query = xpath trim_text = !query.index("text()").nil? val = @document.find_by_xpath(query).collect {|node| (trim_text ? node.text.strip : node.text) } term.deserialize(val) @@ -118,9 +124,13 @@ val.inspect end def ==(other) other == val + end + + def !=(other) + val != other end def eql?(other) self == other end