Sha256: 33aa4ef9c8f51d05d75318fb3e7beb9cda386c6734d1320aa25466fd2216d845

Contents?: true

Size: 961 Bytes

Versions: 1

Compression:

Stored size: 961 Bytes

Contents

# frozen_string_literal: true

module Grape
  module Roar
    module Extensions
      module Relations
        module Adapters
          class Base
            class << self
              def valid_for?(klass)
                valid_proc.call(klass)
              rescue
                false
              end

              def valid_for(&block)
                @valid_proc = block
              end

              private

              attr_reader :valid_proc
            end

            def initialize(klass)
              @klass = klass
            end

            def collection_methods
              raise NotImplementedError
            end

            def name_for_represented(_represented)
              raise NotImplementedError
            end

            def single_entity_methods
              raise NotImplementedError
            end

            private

            attr_reader :klass
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grape-roar-0.4.1 lib/grape/roar/extensions/relations/adapters/base.rb