Sha256: 407256ad3531e168dcdd90242cb750f4f3595b49fdac15a2006f4608b97a3a17

Contents?: true

Size: 717 Bytes

Versions: 18

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

module MediaTypes
  class Scheme
    class ValidationOptions
      attr_accessor :exhaustive, :strict, :backtrace

      def initialize(exhaustive: true, strict: true, backtrace: [])
        self.exhaustive = exhaustive
        self.strict = strict
        self.backtrace = backtrace
      end

      def with_backtrace(backtrace)
        ValidationOptions.new(exhaustive: exhaustive, strict: strict, backtrace: backtrace)
      end

      def trace(*traces)
        with_backtrace(backtrace.dup.concat(traces))
      end

      def exhaustive!
        ValidationOptions.new(exhaustive: true, strict: strict, backtrace: backtrace)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
media_types-0.6.1 lib/media_types/scheme/validation_options.rb
media_types-0.6.0 lib/media_types/scheme/validation_options.rb
media_types-0.5.5 lib/media_types/scheme/validation_options.rb
media_types-0.5.4 lib/media_types/scheme/validation_options.rb
media_types-0.5.3 lib/media_types/scheme/validation_options.rb
media_types-0.5.2 lib/media_types/scheme/validation_options.rb
media_types-0.5.1 lib/media_types/scheme/validation_options.rb
media_types-0.5.0 lib/media_types/scheme/validation_options.rb
media_types-0.4.1 lib/media_types/scheme/validation_options.rb
media_types-0.4.0 lib/media_types/scheme/validation_options.rb
media_types-0.3.0 lib/media_types/scheme/validation_options.rb
media_types-0.2.6 lib/media_types/scheme/validation_options.rb
media_types-0.2.5 lib/media_types/scheme/validation_options.rb
media_types-0.2.4 lib/media_types/scheme/validation_options.rb
media_types-0.2.3 lib/media_types/scheme/validation_options.rb
media_types-0.2.2 lib/media_types/scheme/validation_options.rb
media_types-0.2.1 lib/media_types/scheme/validation_options.rb
media_types-0.2.0 lib/media_types/scheme/validation_options.rb