Sha256: 5e62390a20b76f882382b0e53f6cde137bad0389ff5807d8206a0881434ebca1

Contents?: true

Size: 513 Bytes

Versions: 15

Compression:

Stored size: 513 Bytes

Contents

module Railjet
  module Policy
    extend  ::ActiveSupport::Concern
    include Railjet::Validator

    included do
      const_set(:Error, Class.new(Railjet::PolicyError))
    end

    def initialize(context, object)
      @context, @object = context, object
    end
    
    attr_reader :context, :object

    module ClassMethods
      def context(*context_members)
        delegate *context_members, to: :context
      end

      def object(name)
        alias_method name, :object
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
railjet-4.0.0 lib/railjet/policy.rb
railjet-3.5.0 lib/railjet/policy.rb
railjet-3.4.0 lib/railjet/policy.rb
railjet-3.3.0 lib/railjet/policy.rb
railjet-3.2.0 lib/railjet/policy.rb
railjet-3.1.0 lib/railjet/policy.rb
railjet-3.0.0 lib/railjet/policy.rb
railjet-2.1.1 lib/railjet/policy.rb
railjet-2.1 lib/railjet/policy.rb
railjet-2.0 lib/railjet/policy.rb
railjet-2.0.pre4 lib/railjet/policy.rb
railjet-2.0.pre3 lib/railjet/policy.rb
railjet-2.0.pre2 lib/railjet/policy.rb
railjet-2.0.pre1 lib/railjet/policy.rb
railjet-2.0.pre lib/railjet/policy.rb