Top Level Namespace
Defined Under Namespace
Modules: Bananomia, Configuration, Faraday
Classes: Hash
Instance Method Summary
collapse
Instance Method Details
#field_query_handler(x) ⇒ Object
16
17
18
19
|
# File 'lib/bananomia/utils.rb', line 16
def field_query_handler(x)
tmp = x.keep_if { |z| z.match(/query_/) }
rename_query_filters(tmp)
end
|
#make_user_agent ⇒ Object
5
6
7
8
9
10
11
12
13
14
|
# File 'lib/bananomia/utils.rb', line 5
def make_user_agent
requa = "Faraday/v" + Faraday::VERSION
habua = "Bananomia/v" + Bananomia::VERSION
ua = requa + " " + habua
if Bananomia.mailto
ua += " (mailto:%s)" % Bananomia.mailto
end
ua
end
|
#rename_query_filters(foo) ⇒ Object
21
22
23
24
25
|
# File 'lib/bananomia/utils.rb', line 21
def rename_query_filters(foo)
foo = foo.tostrings
foo = foo.map { |x, y| [x.to_s.sub("container_title", "container-title"), y] }.to_h
foo.map { |x, y| [x.to_s.sub("query_", "query."), y] }.to_h
end
|