Sha256: 28396d7d3751c8e82e77756b00179b9a23b7e15d4d99cd457c2fb9cef8e6316e

Contents?: true

Size: 962 Bytes

Versions: 1

Compression:

Stored size: 962 Bytes

Contents

# frozen_string_literal: true

require 'ostruct'

module GlobalRegistry #:nodoc:
  module Bindings #:nodoc:
    module Options
      class EntityClassOptions
        delegate :id_column,
                 :mdm_id_column,
                 :type,
                 :mdm_timeout,
                 :push_on,
                 :parent_association,
                 :parent_association_class,
                 :exclude_fields,
                 :extra_fields, to: :@options

        def initialize(model_class)
          @model_class = model_class
          @options = OpenStruct.new model_class._global_registry_bindings_options[:entity]
        end

        def ensure_entity_type?
          @options.ensure_entity_type.present?
        end

        def include_all_columns?
          @options.include_all_columns.present?
        end

        def mdm_worker_class_name
          "Pull#{@model_class.name.tr(':', '')}MdmIdWorker"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
global-registry-bindings-0.1.2 lib/global_registry_bindings/options/entity_class_options.rb