Sha256: ddfb52dbb9f16be5c9a607b55b069f166b94a81d0367fe40da4bf34ed19f54a2

Contents?: true

Size: 747 Bytes

Versions: 1

Compression:

Stored size: 747 Bytes

Contents

# frozen_string_literal: true

require 'active_support/concern'

module SnFoil
  module Policy
    extend ActiveSupport::Concern

    attr_reader :record, :entity, :options
    def initialize(record, entity = nil, options = {})
      @record = record
      @entity = entity
      @options = options
    end

    def index?
      false
    end

    def show?
      false
    end

    def create?
      false
    end

    def update?
      false
    end

    def destroy?
      false
    end

    def associate?
      false
    end

    class Scope
      attr_reader :scope, :entity

      def initialize(scope, entity = nil)
        @entity = entity
        @scope = scope
      end

      def resolve
        scope.all
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
snfoil-0.3.0 lib/sn_foil/policy.rb