Module: GlobalRegistry::Bindings

Defined in:
lib/global_registry_bindings/worker.rb,
lib/global_registry_bindings.rb,
lib/global_registry_bindings/options.rb,
lib/global_registry_bindings/railtie.rb,
lib/global_registry_bindings/testing.rb,
lib/global_registry_bindings/version.rb,
lib/global_registry_bindings/exceptions.rb,
lib/global_registry_bindings/model/entity.rb,
lib/global_registry_bindings/model/pull_mdm.rb,
lib/global_registry_bindings/model/push_entity.rb,
lib/global_registry_bindings/entity/mdm_methods.rb,
lib/global_registry_bindings/model/relationship.rb,
lib/global_registry_bindings/model/delete_entity.rb,
lib/global_registry_bindings/model/push_relationship.rb,
lib/global_registry_bindings/global_registry_bindings.rb,
lib/global_registry_bindings/entity/entity_type_methods.rb,
lib/global_registry_bindings/entity/push_entity_methods.rb,
lib/global_registry_bindings/workers/pull_mdm_id_worker.rb,
lib/global_registry_bindings/workers/push_entity_worker.rb,
lib/global_registry_bindings/options/entity_class_options.rb,
lib/global_registry_bindings/workers/delete_entity_worker.rb,
lib/global_registry_bindings/options/entity_options_parser.rb,
lib/global_registry_bindings/options/entity_instance_options.rb,
lib/global_registry_bindings/entity/push_relationship_methods.rb,
lib/global_registry_bindings/entity/relationship_type_methods.rb,
lib/global_registry_bindings/workers/push_relationship_worker.rb,
lib/global_registry_bindings/options/relationship_class_options.rb,
lib/global_registry_bindings/options/relationship_options_parser.rb,
lib/global_registry_bindings/options/relationship_instance_options.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Entity, Model, Options, Workers Classes: EntityMissingMdmId, ParentEntityMissingGlobalRegistryId, Railtie, RecordMissingGlobalRegistryId, RelatedEntityExistsWithCID, RelatedEntityMissingGlobalRegistryId, RelatedEntityTypeMissing, Testing, Worker

Constant Summary collapse

VERSION =
"0.7.2"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



9
10
11
# File 'lib/global_registry_bindings.rb', line 9

def self.configure
  yield self
end

.redis_error_actionObject



21
22
23
# File 'lib/global_registry_bindings.rb', line 21

def self.redis_error_action
  @redis_error_action ||= :log
end

.redis_error_action=(action) ⇒ Object



25
26
27
28
# File 'lib/global_registry_bindings.rb', line 25

def self.redis_error_action=(action)
  action = :log unless %i[ignore log raise].include? action
  @redis_error_action = action
end

.sidekiq_optionsObject



13
14
15
# File 'lib/global_registry_bindings.rb', line 13

def self.sidekiq_options
  @sidekiq_options ||= {}
end

.sidekiq_options=(opts) ⇒ Object



17
18
19
# File 'lib/global_registry_bindings.rb', line 17

def self.sidekiq_options=(opts)
  @sidekiq_options = opts
end

Instance Method Details

#global_registry_bindings(options = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/global_registry_bindings/global_registry_bindings.rb', line 19

def global_registry_bindings(options = {})
  options[:binding] ||= :entity
  unless method_defined? :_global_registry_bindings_options
    class_attribute :_global_registry_bindings_options
    self._global_registry_bindings_options = {entity: nil, relationships: {}}
  end
  if options[:binding] == :entity
    global_registry_bindings_entity options
  elsif options[:binding] == :relationship
    global_registry_bindings_relationship options
  else
    raise ArgumentError, ":binding option must be :entity or :relationship"
  end
end