Class: SearchRequest
- Inherits:
-
Object
- Object
- SearchRequest
- Defined in:
- lib/dto/search/search_request.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
annotations attribute should be a Hash object.
-
#body ⇒ Object
annotations attribute should be a Hash object.
-
#category ⇒ Object
annotations attribute should be a Hash object.
-
#end ⇒ Object
annotations attribute should be a Hash object.
-
#external_id ⇒ Object
annotations attribute should be a Hash object.
-
#heading ⇒ Object
annotations attribute should be a Hash object.
-
#location ⇒ Object
annotations attribute should be a Hash object.
-
#page ⇒ Object
annotations attribute should be a Hash object.
-
#retvals ⇒ Object
annotations attribute should be a Hash object.
-
#rpp ⇒ Object
annotations attribute should be a Hash object.
-
#source ⇒ Object
annotations attribute should be a Hash object.
-
#start ⇒ Object
annotations attribute should be a Hash object.
-
#text ⇒ Object
annotations attribute should be a Hash object.
-
#trusted_annotations ⇒ Object
annotations attribute should be a Hash object.
Instance Method Summary collapse
Instance Attribute Details
#annotations ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def annotations @annotations end |
#body ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def body @body end |
#category ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def category @category end |
#end ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def end @end end |
#external_id ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def external_id @external_id end |
#heading ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def heading @heading end |
#location ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def location @location end |
#page ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def page @page end |
#retvals ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def retvals @retvals end |
#rpp ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def rpp @rpp end |
#source ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def source @source end |
#start ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def start @start end |
#text ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def text @text end |
#trusted_annotations ⇒ Object
annotations attribute should be a Hash object
3 4 5 |
# File 'lib/dto/search/search_request.rb', line 3 def trusted_annotations @trusted_annotations end |
Instance Method Details
#add_retval(retval) ⇒ Object
7 8 9 |
# File 'lib/dto/search/search_request.rb', line 7 def add_retval(retval) @retvals << retval end |
#query_params ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/dto/search/search_request.rb', line 11 def query_params query = Hash.new url_params = '' if (rpp != nil) query[:rpp] = rpp.to_s; url_params += "rpp=#{CGI.escape(query[:rpp])}&" end if (page != nil) query[:page] = page.to_s; url_params += "page=#{CGI.escape(query[:page])}&" end if (source != nil) query[:source] = source.to_s; url_params += "source=#{CGI.escape(query[:source])}&" end if (category != nil) query[:category] = category.to_s; url_params += "category=#{CGI.escape(query[:category])}&" end if (location != nil) query[:location] = location.to_s; url_params += "location=#{CGI.escape(query[:location])}&" end if (heading != nil) query[:heading] = heading.to_s; url_params += "heading=#{CGI.escape(query[:heading])}&" end if (body != nil) query[:body] = body.to_s; url_params += "body=#{CGI.escape(query[:body])}&" end if (text != nil) query[:text] = text.to_s; url_params += "text=#{CGI.escape(query[:text])}&" end if (external_id != nil) query[:external_id] = external_id.to_s; url_params += "external_id=#{CGI.escape(query[:external_id])}&" end if (start != nil) query[:start] = start.to_s; url_params += "start=#{CGI.escape(query[:start])}&" end if (self.end != nil) query[:end] = self.end.to_s; url_params += "end=#{CGI.escape(query[:end])}&" end if (annotations != nil && annotations.size > 0) # query[:annotations] = ActiveSupport::JSON.encode(annotations) query[:annotations] = annotations # query.each do |key, value| # url_params += "#{key}=#{value}&" # end url_params += "annotations=#{CGI.escape(ActiveSupport::JSON.encode(query[:annotations]))}&" #'annotations=#{CGI.escape(ActiveSupport::JSON.encode(search.annotations))}' end if (trusted_annotations != nil && trusted_annotations.size > 0) #query[:trusted_annotations] = ActiveSupport::JSON.encode(trusted_annotations) query[:trusted_annotations] = trusted_annotations url_params += "trusted_annotations=#{CGI.escape(ActiveSupport::JSON.encode(query[:trusted_annotations]))}&" end if (retvals != nil) query[:retvals] = retvals.join(',') #queryParams.put("retvals", Utils.join(retvals)); url_params += "retvals=#{CGI.escape(query[:retvals])}&" end url_params end |