Sha256: 417e975d75aa2bf36807f783fdd0ac28c474d3320d0254fa2f94fa10bda33cdd

Contents?: true

Size: 571 Bytes

Versions: 2

Compression:

Stored size: 571 Bytes

Contents

module Grape
  module Batch
    class Configuration
      attr_accessor :path, :limit, :formatter

      def initialize
        @path  = '/batch'
        @limit = 10
        @formatter = Grape::Batch::Response
      end
    end

    # Set default configuration for Grape::Batch middleware
    class << self
      attr_accessor :configuration
    end

    def self.configuration
      @configuration ||= Configuration.new
    end

    def self.configuration=(config)
      @configuration = config
    end

    def self.configure
      yield configuration
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
grape-batch-1.1.1 lib/grape/batch/configuration.rb
grape-batch-1.1.0 lib/grape/batch/configuration.rb