Sha256: 7e16ef8a0c1a6ea213777695aef88e20b54969f6e9fba56429c8c695e2346e92

Contents?: true

Size: 348 Bytes

Versions: 11

Compression:

Stored size: 348 Bytes

Contents

module Martyr
  module Schema
    class NamedScope
      include ActiveModel::Model

      attr_reader :name, :proc

      def initialize(name, proc)
        @name = name.to_s
        @proc = proc.to_proc
      end

      def run(query_context_builder, *args)
        query_context_builder.instance_exec(*args, &@proc)
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
martyr-0.1.85.pre lib/martyr/schema/named_scopes/named_scope.rb
martyr-0.1.84.pre lib/martyr/schema/named_scopes/named_scope.rb
martyr-0.1.82.pre lib/martyr/schema/named_scopes/named_scope.rb
martyr-0.1.81.pre lib/martyr/schema/named_scopes/named_scope.rb
martyr-0.1.80.pre lib/martyr/schema/named_scopes/named_scope.rb
martyr-0.1.79.pre lib/martyr/schema/named_scopes/named_scope.rb
martyr-0.1.78.pre lib/martyr/schema/named_scopes/named_scope.rb
martyr-0.1.77.pre lib/martyr/schema/named_scopes/named_scope.rb
martyr-0.1.76.pre lib/martyr/schema/named_scopes/named_scope.rb
martyr-0.1.75.pre lib/martyr/schema/named_scopes/named_scope.rb
martyr-0.1.74.pre lib/martyr/schema/named_scopes/named_scope.rb