rexle 0.9.65 → 0.9.66
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rexle.rb +8 -1
- metadata +1 -1
data/lib/rexle.rb
CHANGED
@@ -767,7 +767,12 @@ class Rexle
|
|
767
767
|
def elements(s=nil) @doc.elements(s) end
|
768
768
|
def name() @doc.root.name end
|
769
769
|
def to_a() @a end
|
770
|
-
|
770
|
+
|
771
|
+
def to_s(options={})
|
772
|
+
return '<UNDEFINED/>' unless @doc
|
773
|
+
self.xml options
|
774
|
+
end
|
775
|
+
|
771
776
|
def text(xpath) @doc.text(xpath) end
|
772
777
|
def root() @doc.elements.first end
|
773
778
|
|
@@ -776,6 +781,8 @@ class Rexle
|
|
776
781
|
end
|
777
782
|
|
778
783
|
def xml(options={})
|
784
|
+
|
785
|
+
return '' unless @doc
|
779
786
|
o = {pretty: false, declaration: true}.merge(options)
|
780
787
|
msg = o[:pretty] == false ? :doc_print : :doc_pretty_print
|
781
788
|
|