Sha256: 841bf77b64580c268b93e30ba2d3ab956e976c600bbbaea534fb4efbe4cf4efc
Contents?: true
Size: 465 Bytes
Versions: 18
Compression:
Stored size: 465 Bytes
Contents
class Apiv1::Taxons::IndexController < Apiv1::HomeController def index render json: { taxons: _taxons } end private def _taxons Apiv1::Taxon.pipeline -> (t) { t.by_root_genus(params[:root_genus]) if params[:root_genus].present? }, -> (t) { t.children_of_parent(params[:parent_id]) if params[:parent_id].present? }, -> (t) { t.root_generation if params.has_key?(:parent_id) && params[:parent_id].blank? }, -> (t) { t.all } end end
Version data entries
18 entries across 18 versions & 1 rubygems