Sha256: c90b733ae459d36a45189bd58159beb65cac1988fa01020382c957170fd198f5
Contents?: true
Size: 711 Bytes
Versions: 39
Compression:
Stored size: 711 Bytes
Contents
module JsonapiCompliable # @api private module Scoping::Filterable # @api private def find_filter(name) find_filter!(name) rescue JsonapiCompliable::Errors::BadFilter nil end # @api private def find_filter!(name) filter_name, filter_value = \ resource.filters.find { |_name, opts| opts[:aliases].include?(name.to_sym) } raise JsonapiCompliable::Errors::BadFilter unless filter_name if guard = filter_value[:if] raise JsonapiCompliable::Errors::BadFilter if resource.context.send(guard) == false end { filter_name => filter_value } end # @api private def filter_param query_hash[:filter] end end end
Version data entries
39 entries across 39 versions & 1 rubygems