endeca_on_demand 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. data/.gitignore +3 -0
  2. data/.travis.yml +3 -0
  3. data/Gemfile +14 -0
  4. data/Guardfile +5 -0
  5. data/{README.rdoc → README.md} +97 -71
  6. data/Rakefile +4 -0
  7. data/endeca_on_demand.gemspec +6 -5
  8. data/lib/endeca_on_demand.rb +11 -299
  9. data/lib/endeca_on_demand/client.rb +16 -14
  10. data/lib/endeca_on_demand/collection.rb +29 -27
  11. data/lib/endeca_on_demand/core_ext.rb +1 -0
  12. data/lib/endeca_on_demand/core_ext/hash.rb +30 -0
  13. data/lib/endeca_on_demand/pp.rb +39 -37
  14. data/lib/endeca_on_demand/proxy.rb +49 -57
  15. data/lib/endeca_on_demand/query.rb +129 -147
  16. data/lib/endeca_on_demand/response.rb +50 -41
  17. data/lib/endeca_on_demand/response/applied_filters.rb +33 -25
  18. data/lib/endeca_on_demand/response/applied_filters/keyword_redirect.rb +28 -27
  19. data/lib/endeca_on_demand/response/applied_filters/search_report.rb +36 -33
  20. data/lib/endeca_on_demand/response/applied_filters/search_report/search.rb +30 -27
  21. data/lib/endeca_on_demand/response/applied_filters/selected_dimension_value_id.rb +26 -20
  22. data/lib/endeca_on_demand/response/breadcrumb.rb +26 -20
  23. data/lib/endeca_on_demand/response/breadcrumb/bread.rb +29 -28
  24. data/lib/endeca_on_demand/response/business_rules_result.rb +25 -19
  25. data/lib/endeca_on_demand/response/business_rules_result/business_rule.rb +36 -35
  26. data/lib/endeca_on_demand/response/dimension.rb +34 -33
  27. data/lib/endeca_on_demand/response/dimension/dimension_value.rb +28 -35
  28. data/lib/endeca_on_demand/response/property.rb +29 -22
  29. data/lib/endeca_on_demand/response/records_set.rb +40 -32
  30. data/lib/endeca_on_demand/response/records_set/record.rb +43 -36
  31. data/lib/endeca_on_demand/version.rb +1 -1
  32. data/spec/endeca_on_demand_spec.rb +11 -0
  33. data/spec/spec_helper.rb +21 -0
  34. metadata +59 -29
@@ -1,24 +1,26 @@
1
- class EndecaOnDemand::Client
1
+ module EndecaOnDemand
2
+ class Client
2
3
 
3
- include EndecaOnDemand::PP
4
+ include EndecaOnDemand::PP
4
5
 
5
- def inspect_attributes; [ :api, :default_options ]; end
6
+ def inspect_attributes; [ :api, :default_options ]; end
6
7
 
7
- ## fields ##
8
+ ## fields ##
8
9
 
9
- attr_reader :api, :default_options, :query
10
+ attr_reader :api, :default_options, :query
10
11
 
11
- def initialize(api, default_options = {})
12
- @api, @default_options = api, default_options.dup.recurse(&:symbolize_keys)
13
- end
12
+ def initialize(api, default_options = {})
13
+ @api, @default_options = api, default_options.dup.recurse(&:symbolize_keys)
14
+ end
14
15
 
15
- ## associations ##
16
+ ## associations ##
16
17
 
17
- def query(options = {})
18
- @query = nil if options.present?
19
- @query ||= EndecaOnDemand::Query.new(self, options)
20
- end
18
+ def query(options = {})
19
+ @query = nil if options.present?
20
+ @query ||= EndecaOnDemand::Query.new(self, options)
21
+ end
21
22
 
22
- ##
23
+ ##
23
24
 
25
+ end
24
26
  end
@@ -1,41 +1,43 @@
1
- class EndecaOnDemand::Collection < EndecaOnDemand::Proxy
1
+ module EndecaOnDemand
2
+ class Collection < EndecaOnDemand::Proxy
2
3
 
3
- attr_reader :klass, :target
4
+ attr_reader :klass, :target
4
5
 
5
- def initialize(klass, target, mapping = nil)
6
- @klass, @target = klass, target
7
- @target = target.map { |object| @klass.new(mapping, object) } if mapping.present?
8
- extend klass.collection_class if klass.respond_to?(:collection_class)
9
- end
6
+ def initialize(klass, target, mapping = nil)
7
+ @klass, @target = klass, target
8
+ @target = target.map { |object| @klass.new(mapping, object) } if mapping.present?
9
+ extend klass.collection_class if klass.respond_to?(:collection_class)
10
+ end
10
11
 
11
- ## override proxy ##
12
+ ## override proxy ##
12
13
 
13
- def class
14
- EndecaOnDemand::Collection
15
- end
14
+ def class
15
+ EndecaOnDemand::Collection
16
+ end
16
17
 
17
- def inspect
18
- target.to_a.inspect
19
- end
18
+ def inspect
19
+ target.to_a.inspect
20
+ end
20
21
 
21
- ##
22
+ ##
22
23
 
23
- def where(conditions = {})
24
- target.select do |object|
25
- conditions.all? do |key,value|
26
- value.is_a?(Regexp) ? object.send(key) =~ value : object.send(key) == value
24
+ def where(conditions = {})
25
+ target.select do |object|
26
+ conditions.all? do |key,value|
27
+ value.is_a?(Regexp) ? object.send(key) =~ value : object.send(key) == value
28
+ end
27
29
  end
28
30
  end
29
- end
30
31
 
31
- protected
32
+ protected
32
33
 
33
- def wrap_collection(collection)
34
- EndecaOnDemand::Collection.new(klass, collection)
35
- end
34
+ def wrap_collection(collection)
35
+ EndecaOnDemand::Collection.new(klass, collection)
36
+ end
36
37
 
37
- def method_missing(name, *args, &block)
38
- target.send(name, *args, &block)
39
- end
38
+ def method_missing(name, *args, &block)
39
+ target.send(name, *args, &block)
40
+ end
40
41
 
42
+ end
41
43
  end
@@ -0,0 +1 @@
1
+ require 'endeca_on_demand/core_ext/hash'
@@ -0,0 +1,30 @@
1
+ # source: https://github.com/rubyworks/facets
2
+ class Hash
3
+
4
+ # Apply a block to hash, and recursively apply that block
5
+ # to each sub-hash or +types+.
6
+ #
7
+ # h = {:a=>1, :b=>{:b1=>1, :b2=>2}}
8
+ # g = h.recurse{|h| h.inject({}){|h,(k,v)| h[k.to_s] = v; h} }
9
+ # g #=> {"a"=>1, "b"=>{"b1"=>1, "b2"=>2}}
10
+ #
11
+ def recurse(*types, &block)
12
+ types = [self.class] if types.empty?
13
+ h = inject({}) do |hash, (key, value)|
14
+ case value
15
+ when *types
16
+ hash[key] = value.recurse(*types, &block)
17
+ else
18
+ hash[key] = value
19
+ end
20
+ hash
21
+ end
22
+ yield h
23
+ end
24
+
25
+ # In place form of #recurse.
26
+ def recurse!(&block)
27
+ replace(recurse(&block))
28
+ end
29
+
30
+ end
@@ -1,48 +1,50 @@
1
- module EndecaOnDemand::PP
1
+ module EndecaOnDemand
2
+ module PP
2
3
 
3
- def inspect # :nodoc:
4
- return super if not respond_to?(:inspect_attributes) or inspect_attributes.blank?
5
- attributes = inspect_attributes.reject { |x|
6
- begin
7
- attribute = send x
8
- attribute.blank?
9
- rescue NoMethodError
10
- true
11
- end
12
- }.map { |attribute|
13
- "#{attribute.to_s.sub(/_\w+/, 's')}=#{send(attribute).inspect}"
14
- }.join ' '
15
- "#<#{self.class.name}:#{sprintf("0x%x", object_id)} #{attributes}>"
16
- end
4
+ def inspect # :nodoc:
5
+ return super if not respond_to?(:inspect_attributes) or inspect_attributes.blank?
6
+ attributes = inspect_attributes.reject { |x|
7
+ begin
8
+ attribute = send x
9
+ attribute.blank?
10
+ rescue NoMethodError
11
+ true
12
+ end
13
+ }.map { |attribute|
14
+ "#{attribute.to_s.sub(/_\w+/, 's')}=#{send(attribute).inspect}"
15
+ }.join ' '
16
+ "#<#{self.class.name}:#{sprintf("0x%x", object_id)} #{attributes}>"
17
+ end
17
18
 
18
- def pretty_print pp # :nodoc:
19
- return super if not respond_to?(:inspect_attributes) or inspect_attributes.blank?
20
- nice_name = self.class.name
21
- pp.group(2, "#(#{nice_name}:#{sprintf("0x%x", object_id)} {", '})') do
19
+ def pretty_print pp # :nodoc:
20
+ return super if not respond_to?(:inspect_attributes) or inspect_attributes.blank?
21
+ nice_name = self.class.name
22
+ pp.group(2, "#(#{nice_name}:#{sprintf("0x%x", object_id)} {", '})') do
22
23
 
23
- pp.breakable
24
- attrs = inspect_attributes.map { |t|
25
- [t, send(t)] if respond_to?(t)
26
- }.compact.find_all { |x|
27
- x.last.present?
28
- }
24
+ pp.breakable
25
+ attrs = inspect_attributes.map { |t|
26
+ [t, send(t)] if respond_to?(t)
27
+ }.compact.find_all { |x|
28
+ x.last.present?
29
+ }
29
30
 
30
- pp.seplist(attrs) do |v|
31
- if v.last.class == EndecaOnDemand::Collection
32
- pp.group(2, "#{v.first} = [", "]") do
33
- pp.breakable
34
- pp.seplist(v.last) do |item|
35
- pp.pp item
31
+ pp.seplist(attrs) do |v|
32
+ if v.last.class == EndecaOnDemand::Collection
33
+ pp.group(2, "#{v.first} = [", "]") do
34
+ pp.breakable
35
+ pp.seplist(v.last) do |item|
36
+ pp.pp item
37
+ end
36
38
  end
39
+ else
40
+ pp.text "#{v.first} = "
41
+ pp.pp v.last
37
42
  end
38
- else
39
- pp.text "#{v.first} = "
40
- pp.pp v.last
41
43
  end
42
- end
43
- pp.breakable
44
+ pp.breakable
44
45
 
46
+ end
45
47
  end
46
- end
47
48
 
49
+ end
48
50
  end
@@ -1,61 +1,53 @@
1
- class EndecaOnDemand::Proxy
2
-
3
- # We undefine most methods to get them sent through to the target.
4
- instance_methods.each do |method|
5
- undef_method(method) unless
6
- method =~ /(^__|^send$|^object_id$|^extend$|^respond_to\?$|^tap$|^inspect$|^pretty_)/
7
- end
8
-
9
- attr_accessor :xml
10
-
11
- # def inspect
12
- # respond_to?(:inspection) ?
13
- # "#<#{self.class.name} #{inspection.kind_of?(Hash) ? inspection.inspect : (inspection * ', ')}>" :
14
- # super
15
- # end
16
-
17
- def inspect # :nodoc:
18
- return super if not respond_to?(:inspect_attributes) or inspect_attributes.blank?
19
- attributes = inspect_attributes.reject { |x|
20
- begin
21
- attribute = send x
22
- attribute.blank?
23
- rescue NoMethodError
24
- true
1
+ module EndecaOnDemand
2
+ class Proxy
3
+
4
+ # We undefine most methods to get them sent through to the target.
5
+ instance_methods.each do |method|
6
+ undef_method(method) unless
7
+ method =~ /(^__|^send$|^object_id$|^extend$|^respond_to\?$|^tap$|^inspect$|^pretty_|^class_eval$|^method$|^instance_$)/
8
+ end
9
+
10
+ attr_accessor :xml
11
+
12
+ def inspect # :nodoc:
13
+ return super if not respond_to?(:inspect_attributes) or inspect_attributes.blank?
14
+ attributes = inspect_attributes.reject { |x|
15
+ begin
16
+ attribute = send x
17
+ attribute.blank?
18
+ rescue NoMethodError
19
+ true
20
+ end
21
+ }.map { |attribute|
22
+ "#{attribute.to_s.sub(/_\w+/, 's')}=#{send(attribute).inspect}"
23
+ }.join ' '
24
+ "#<#{self.class.name}:#{sprintf("0x%x", object_id)} #{attributes}>"
25
+ end
26
+
27
+ protected
28
+
29
+ # Default behavior of method missing should be to delegate all calls
30
+ # to the target of the proxy. This can be overridden in special cases.
31
+ #
32
+ # @param [ String, Symbol ] name The name of the method.
33
+ # @param [ Array ] *args The arguments passed to the method.
34
+ def method_missing(name, *args, &block)
35
+ xml.send(name, *args, &block)
36
+ end
37
+
38
+ def define_getters(lookup)
39
+ mod = Module.new
40
+ extend mod
41
+ send(lookup).keys.each do |key|
42
+ mod.class_eval <<-RUBY, __FILE__, __LINE__+1
43
+
44
+ def #{key}
45
+ send(#{lookup.inspect})[#{key.inspect}]
46
+ end
47
+
48
+ RUBY
25
49
  end
26
- }.map { |attribute|
27
- "#{attribute.to_s.sub(/_\w+/, 's')}=#{send(attribute).inspect}"
28
- }.join ' '
29
- "#<#{self.class.name}:#{sprintf("0x%x", object_id)} #{attributes}>"
30
- end
50
+ end
31
51
 
32
- # def pretty_inspect
33
- # respond_to?(:inspection) ?
34
- # "#(#{self.class.name} {\n #{inspection.pretty_inspect}\n})" :
35
- # super
36
- # end
37
-
38
- # def inspect
39
- # inspection = []
40
- # inspection.concat(options.dup.delete_if { |k,v| v.blank? }.sort_by(&:first).map { |k,v| "#{k}: #{v.inspect}" })
41
- # "#<#{self.class.name} #{inspection * ', '}>"
42
- # end
43
-
44
- protected
45
-
46
- # Default behavior of method missing should be to delegate all calls
47
- # to the target of the proxy. This can be overridden in special cases.
48
- #
49
- # @param [ String, Symbol ] name The name of the method.
50
- # @param [ Array ] *args The arguments passed to the method.
51
- def method_missing(name, *args, &block)
52
- xml.send(name, *args, &block)
53
52
  end
54
-
55
- # def method_missing(method, *args, &block)
56
- # unless self.instance_variables.include?(:"@#{method}")
57
- # "#{method} is unavailable."
58
- # end
59
- # end
60
-
61
53
  end
@@ -1,195 +1,177 @@
1
- class EndecaOnDemand::Query
1
+ module EndecaOnDemand
2
+ class Query
2
3
 
3
- include EndecaOnDemand::PP
4
+ include EndecaOnDemand::PP
4
5
 
5
- def inspect_attributes; [ :uri, :xml, :errors, :options ]; end
6
+ def inspect_attributes; [ :uri, :xml, :errors, :options ]; end
6
7
 
7
- ## fields ##
8
+ ## fields ##
8
9
 
9
- attr_reader :body, :client, :errors, :http, :options, :response, :uri, :xml
10
+ attr_reader :body, :client, :errors, :http, :options, :response, :uri, :xml
10
11
 
11
- def initialize(client, options = {})
12
- @client, @options = client, options.dup.recurse(&:symbolize_keys)
12
+ def initialize(client, options = {})
13
+ @client, @options = client, options.dup.recurse(&:symbolize_keys)
13
14
 
14
- process_options!
15
- end
15
+ process_options!
16
+ end
16
17
 
17
- ## associations ##
18
+ ## associations ##
18
19
 
19
- def body
20
- @body ||= to_xml
21
- end
20
+ def body
21
+ @body ||= to_xml
22
+ end
22
23
 
23
- def http
24
- @http ||= Net::HTTP.new(uri.host, uri.port)
25
- end
24
+ def http
25
+ @http ||= Net::HTTP.new(uri.host, uri.port)
26
+ end
26
27
 
27
- def response
28
- @response ||= EndecaOnDemand::Response.new(self, http.post(uri.path, body, 'Content-type' => 'application/xml'))
29
- end
28
+ def response
29
+ @response ||= EndecaOnDemand::Response.new(self, http.post(uri.path, body, 'Content-type' => 'application/xml'))
30
+ end
30
31
 
31
- def uri
32
- @uri ||= URI.parse(client.api)
33
- end
32
+ def uri
33
+ @uri ||= URI.parse(client.api)
34
+ end
34
35
 
35
- def xml
36
- @xml ||= Nokogiri::XML(body) { |config| config.strict.noblanks }
37
- end
36
+ def xml
37
+ @xml ||= Nokogiri::XML(body) { |config| config.strict.noblanks }
38
+ end
38
39
 
39
- ##
40
-
41
- ## xml builder ##
42
-
43
- def to_xml
44
- Builder::XmlMarkup.new(indent: 2).tag!(:Query) do |xml|
45
-
46
- Flags(xml)
47
- KeywordSearch(xml)
48
- NavigationQuery(xml)
49
- CategoryNavigationQuery(xml)
50
- Sorting(xml)
51
- Paging(xml)
52
- AdvancedParameters(xml)
53
-
54
- end
55
- # @query.Query do
56
- # @query << @body.target!
57
- # end
58
-
59
- # begin
60
- # # ask Domino what this is?
61
- # # @request, @raw_response = @http.post(@uri.path, @query.target!, 'Content-type' => 'application/xml')
62
-
63
- # @response = Nokogiri::XML(fetch_response.body)
64
-
65
- # build_records
66
- # build_breadcrumbs
67
- # build_dimensions
68
- # build_business_rules
69
- # build_search_reports
70
- # build_selected_dimension_value_ids
71
- # build_keyword_redirect
72
- # rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => error
73
- # @error = error
74
- # end
75
- end
40
+ ##
76
41
 
77
- ### data ###
42
+ ## xml builder ##
78
43
 
79
- def flags
80
- @flags ||= options[:flags] = (options[:flags] || {}).inject({}) do |hash,(key,value)|
81
- hash.tap do
82
- hash[key.to_s.underscore] = value
83
- end
84
- end.symbolize_keys
85
- end
44
+ def to_xml
45
+ Builder::XmlMarkup.new(indent: 2).tag!(:Query) do |xml|
86
46
 
87
- def searches
88
- @searches ||= options[:searches]
89
- end
47
+ Flags(xml)
48
+ KeywordSearch(xml)
49
+ NavigationQuery(xml)
50
+ CategoryNavigationQuery(xml)
51
+ Sorting(xml)
52
+ Paging(xml)
53
+ AdvancedParameters(xml)
90
54
 
91
- def dimensions
92
- @dimensions ||= [*options[:dimensions]]
93
- end
55
+ end
56
+ end
94
57
 
95
- def category
96
- @category ||= options[:category]
97
- end
58
+ ### data ###
98
59
 
99
- def sorts
100
- @sorts ||= options[:sorts]
101
- end
60
+ def flags
61
+ @flags ||= options[:flags] = (options[:flags] || {}).inject({}) do |hash,(key,value)|
62
+ hash.tap do
63
+ hash[key.to_s.underscore] = value
64
+ end
65
+ end.symbolize_keys
66
+ end
102
67
 
103
- def paging
104
- @paging ||= options[:paging] = (options[:paging] || {}).tap do |paging|
105
- if paging.has_key?(:page) and paging.has_key?(:per_page)
106
- paging[:offset] = (paging[:page].to_i * paging[:per_page].to_i rescue 0)
107
- end
108
- end
109
- end
68
+ def searches
69
+ @searches ||= options[:searches]
70
+ end
110
71
 
111
- def advanced_parameters
112
- @advanced_parameters ||= options[:advanced] = (options[:advanced] || {}).inject({}) do |hash,(key,value)|
113
- hash.tap do
114
- hash[key.to_s.underscore] = value
72
+ def dimensions
73
+ @dimensions ||= [*options[:dimensions]]
74
+ end
75
+
76
+ def category
77
+ @category ||= options[:category]
78
+ end
79
+
80
+ def sorts
81
+ @sorts ||= options[:sorts]
82
+ end
83
+
84
+ def paging
85
+ @paging ||= options[:paging] = (options[:paging] || {}).tap do |paging|
86
+ if paging.has_key?(:page) and paging.has_key?(:per_page)
87
+ paging[:offset] = (paging[:page].to_i * paging[:per_page].to_i rescue 0)
88
+ end
115
89
  end
116
- end.symbolize_keys
117
- end
90
+ end
91
+
92
+ def advanced_parameters
93
+ @advanced_parameters ||= options[:advanced] = (options[:advanced] || {}).inject({}) do |hash,(key,value)|
94
+ hash.tap do
95
+ hash[key.to_s.underscore] = value
96
+ end
97
+ end.symbolize_keys
98
+ end
118
99
 
119
- ###
100
+ ###
120
101
 
121
- protected
102
+ protected
122
103
 
123
- def Flags(xml)
124
- return if flags.blank?
125
- flags.each do |flag,value|
126
- xml.tag!(flag.to_s.camelcase, value)
104
+ def Flags(xml)
105
+ return if flags.blank?
106
+ flags.each do |flag,value|
107
+ xml.tag!(flag.to_s.camelcase, value)
108
+ end
127
109
  end
128
- end
129
110
 
130
- def KeywordSearch(xml)
131
- return if searches.blank?
132
- xml.tag!(:Searches) do
133
- searches.each do |key,term|
134
- xml.tag!(:Search) do
135
- xml.tag!('search-key', key.to_s)
136
- xml.tag!('search-term', term.to_s)
111
+ def KeywordSearch(xml)
112
+ return if searches.blank?
113
+ xml.tag!(:Searches) do
114
+ searches.each do |key,term|
115
+ xml.tag!(:Search) do
116
+ xml.tag!('search-key', key.to_s)
117
+ xml.tag!('search-term', term.to_s)
118
+ end
137
119
  end
138
120
  end
139
121
  end
140
- end
141
122
 
142
- def NavigationQuery(xml)
143
- return if dimensions.blank?
144
- xml.tag!(:SelectedDimensionValueIds) do
145
- dimensions.each do |dimension|
146
- xml.tag!(:DimensionValueId, dimension)
123
+ def NavigationQuery(xml)
124
+ return if dimensions.blank?
125
+ xml.tag!(:SelectedDimensionValueIds) do
126
+ dimensions.each do |dimension|
127
+ xml.tag!(:DimensionValueId, dimension)
128
+ end
147
129
  end
148
130
  end
149
- end
150
131
 
151
- def CategoryNavigationQuery(xml)
152
- return if category.blank?
153
- xml.tag!(:Category) do
154
- xml.tag!(:CategoryId, category)
132
+ def CategoryNavigationQuery(xml)
133
+ return if category.blank?
134
+ xml.tag!(:Category) do
135
+ xml.tag!(:CategoryId, category)
136
+ end
155
137
  end
156
- end
157
138
 
158
- def Sorting(xml)
159
- return if sorts.blank?
160
- xml.tag!(:Sorts) do
161
- sorts.each do |key,direction|
162
- xml.tag!(:Sort) do
163
- xml.tag!('sort-key', key.to_s)
164
- xml.tag!('sort-direction', direction.to_s.capitalize)
139
+ def Sorting(xml)
140
+ return if sorts.blank?
141
+ xml.tag!(:Sorts) do
142
+ sorts.each do |key,direction|
143
+ xml.tag!(:Sort) do
144
+ xml.tag!('sort-key', key.to_s)
145
+ xml.tag!('sort-direction', direction.to_s.capitalize)
146
+ end
165
147
  end
166
148
  end
167
149
  end
168
- end
169
150
 
170
- def Paging(xml)
171
- return if paging.blank?
172
- xml.tag!(:RecordOffset, paging[:offset]) if paging.has_key?(:offset)
173
- xml.tag!(:RecordsPerPage, paging[:per_page]) if paging.has_key?(:per_page)
174
- end
151
+ def Paging(xml)
152
+ return if paging.blank?
153
+ xml.tag!(:RecordOffset, paging[:offset]) if paging.has_key?(:offset)
154
+ xml.tag!(:RecordsPerPage, paging[:per_page]) if paging.has_key?(:per_page)
155
+ end
175
156
 
176
- def AdvancedParameters(xml)
157
+ def AdvancedParameters(xml)
177
158
 
178
- end
159
+ end
179
160
 
180
- def process_options!
181
- new_options = (client.default_options[:query] || {}).dup
161
+ def process_options!
162
+ new_options = (client.default_options[:query] || {}).dup
182
163
 
183
- (new_options[:flags] ||= {}).merge!(options[:flags] || {}).recurse(&:symbolize_keys) if options[:flags].present?
184
- (new_options[:paging] ||= {}).merge!(options[:paging] || {}).recurse(&:symbolize_keys) if options[:paging].present?
185
- (new_options[:searches] ||= {}).merge!(options[:searches] || {}).recurse(&:symbolize_keys) if options[:searches].present?
186
- (new_options[:sorts] ||= {}).merge!(options[:sorts] || {}).recurse(&:symbolize_keys) if options[:sorts].present?
187
- (new_options[:dimensions] = [*new_options[:dimensions]]).concat [*options[:dimensions]] if options[:dimensions].present?
188
- new_options[:category] = options[:category] if options[:category].present?
164
+ (new_options[:flags] ||= {}).merge!(options[:flags] || {}).recurse(&:symbolize_keys) if options[:flags].present?
165
+ (new_options[:paging] ||= {}).merge!(options[:paging] || {}).recurse(&:symbolize_keys) if options[:paging].present?
166
+ (new_options[:searches] ||= {}).merge!(options[:searches] || {}).recurse(&:symbolize_keys) if options[:searches].present?
167
+ (new_options[:sorts] ||= {}).merge!(options[:sorts] || {}).recurse(&:symbolize_keys) if options[:sorts].present?
168
+ (new_options[:dimensions] = [*new_options[:dimensions]]).concat [*options[:dimensions]] if options[:dimensions].present?
169
+ new_options[:category] = options[:category] if options[:category].present?
189
170
 
190
- @options = new_options
191
- end
171
+ @options = new_options
172
+ end
192
173
 
193
- ##
174
+ ##
194
175
 
176
+ end
195
177
  end