Module: RailsGSA
- Defined in:
- lib/rails-gsa.rb
Defined Under Namespace
Classes: NoInternetConnectionError
Class Method Summary
collapse
Class Method Details
.default_options ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/rails-gsa.rb', line 9
def self.default_options
@default_options ||= {:gsa_url => "",
:search_term => "",
:output => "json",
:access => "p",
:client => "default_frontend",
:proxystylesheet => "default_frontend",
:site => "default_collection",
:start => 0,
:num => 10
}
end
|
.search(args = {}) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/rails-gsa.rb', line 22
def self.search(args = {})
default_options
@default_options.merge!(args)
raise ArgumentError, "GSA URL missing. Please provide valid arguments." if @default_options[:gsa_url].empty? || @default_options[:gsa_url].nil?
@default_options[:access] = "p" unless ["p", "s", "a"].include?(@default_options[:access])
@default_options[:start] = 0 unless @default_options[:start].is_a?(Fixnum)
@default_options[:num] = 10 unless @default_options[:num].is_a?(Fixnum)
return perform_search
end
|