Module: Google::Search::OrderBy
Constant Summary collapse
- ORDER_BY =
– Constants ++
:relevance, :date
Instance Attribute Summary collapse
-
#order_by ⇒ Object
Order by.
Instance Method Summary collapse
-
#get_uri_params ⇒ Object
:nodoc:.
-
#initialize(options = {}, &block) ⇒ Object
:nodoc:.
Instance Attribute Details
#order_by ⇒ Object
Order by. Defaults to :relevance
- :relevance
- :date
19 20 21 |
# File 'lib/google-search/search/mixins/order_by.rb', line 19 def order_by @order_by end |
Instance Method Details
#get_uri_params ⇒ Object
:nodoc:
30 31 32 33 |
# File 'lib/google-search/search/mixins/order_by.rb', line 30 def get_uri_params validate(:order_by) { |order| order.nil? || ORDER_BY.include?(order) } super + [[:scoring, order_by ? 'd' : nil]] end |
#initialize(options = {}, &block) ⇒ Object
:nodoc:
23 24 25 26 |
# File 'lib/google-search/search/mixins/order_by.rb', line 23 def initialize = {}, &block @order_by = .delete :order_by super end |