Skip to content
This repository was archived by the owner on Oct 24, 2018. It is now read-only.

Commit a667a05

Browse files
committed
Added pretty print method (alias)
1 parent 5bd75bd commit a667a05

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/RubyEDS.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#
1313
# There are, however a few changes:
1414
# - I removed the authenticate_with_file method, as you can use a config to provide credentials anyway (see examples)
15-
- I allowed for both XML and JSON return types (with the default being XML).
15+
# - I allowed for both XML and JSON return types (with the default being XML).
1616
#
1717
# As with Nitin's PyEDS, there are a few things left to do:
1818
# - add more options to basicSearch() like "facets", "search mode", "fulltext", "thesaurus", etc.
@@ -57,6 +57,7 @@ def advanced_search(search_json, return_type="xml")
5757
end
5858

5959
def pretty_print(content) # content can be either XML or JSON
60+
pp content
6061
end
6162

6263
end

test/test_ruby_eds.rb

+1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ def test_basic_search
4444
doc.remove_namespaces!
4545
number_of_hits = doc.xpath("//TotalHits").inner_text || 0
4646
assert_not_equal 0, number_of_hits
47+
pp doc
4748
end
4849
end

0 commit comments

Comments
 (0)