Module: Motor::ApiQuery

Defined in:
lib/motor/api_query.rb,
lib/motor/api_query/sort.rb,
lib/motor/api_query/filter.rb,
lib/motor/api_query/search.rb,
lib/motor/api_query/paginate.rb,
lib/motor/api_query/build_json.rb,
lib/motor/api_query/build_meta.rb,
lib/motor/api_query/apply_scope.rb

Defined Under Namespace

Modules: ApplyScope, BuildJson, BuildMeta, Filter, Paginate, Search, Sort

Class Method Summary collapse

Class Method Details

.call(rel, params) ⇒ Object


7
8
9
10
11
12
13
14
# File 'lib/motor/api_query.rb', line 7

def call(rel, params)
  rel = ApiQuery::Sort.call(rel, params[:sort] || params[:order])
  rel = ApiQuery::Paginate.call(rel, params[:page])
  rel = ApiQuery::Filter.call(rel, params[:filter] || params[:filters])
  rel = ApiQuery::ApplyScope.call(rel, params[:scope])

  ApiQuery::Search.call(rel, params[:q] || params[:search] || params[:query])
end