Sha256: b7c423757ffa52b1c950d4b834326dd765b914219258acb2fbccc83b24a88275

Contents?: true

Size: 407 Bytes

Versions: 5

Compression:

Stored size: 407 Bytes

Contents

# frozen_string_literal: true

module InferModel
  class CommonType
    extend Dry::Initializer

    param :possible_detected_types
    option :unique_constraint_possible, default: -> { false }
    option :non_null_constraint_possible, default: -> { false }

    def detected_type
      possible_detected_types.respond_to?(:first) ? possible_detected_types.first : possible_detected_types
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
infer_model-0.1.5 lib/infer_model/common_type.rb
infer_model-0.1.4 lib/infer_model/common_type.rb
infer_model-0.1.2 lib/infer_model/common_type.rb
infer_model-0.1.1 lib/infer_model/common_type.rb
infer_model-0.1.0 lib/infer_model/common_type.rb