Sha256: c58b05f3982cae54978c3442029f794d5c7e392bcf6a31d579197048915781f4
Contents?: true
Size: 526 Bytes
Versions: 6
Compression:
Stored size: 526 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" module Influxer module Scoping module Named # :nodoc: all extend ActiveSupport::Concern module ClassMethods def scope(name, scope) raise "Scope not defined: #{name}" if scope.nil? || !scope.respond_to?(:call) singleton_class.send(:define_method, name) do |*args| rel = all rel.merge!(rel.scoping { scope.call(*args) }) rel end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems