Module: MongoTanker

Defined in:
lib/mongo_tanker/orm/mongoid.rb,
lib/mongo_tanker.rb,
lib/mongo_tanker/version.rb,
lib/mongo_tanker/tank/index.rb,
lib/mongo_tanker/workers/sidekiq_workers/add_to_index_worker.rb,
lib/mongo_tanker/workers/sidekiq_workers/remove_from_index_worker.rb

Defined Under Namespace

Modules: ORM, Tank, Workers

Constant Summary collapse

VERSION =
"0.1.0"
@@public_url =
ENV['INDEXTANK_PUBLIC_URL']
@@private_url =
ENV['INDEXTANK_PRIVATE_URL']
@@default_index =
Rails.env
@@index_key =
nil
@@run_in_the_background =
false
@@background_engine =
:sidekiq
@@queue_name =
nil

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.queue_name=(value) ⇒ Object



44
45
46
# File 'lib/mongo_tanker.rb', line 44

def self.queue_name=(value)
  @@queue_name = value.to_s.downcase.parameterize.underscore.to_sym
end

.setup {|_self| ... } ⇒ Object

Default way to setup Devise. Run rails generate devise_install to create a fresh initializer with all configuration values.

Yields:

  • (_self)

Yield Parameters:

  • _self (MongoTanker)

    the object that the method was called on



50
51
52
# File 'lib/mongo_tanker.rb', line 50

def self.setup
  yield self
end

Instance Method Details

#background_engineObject

This is for later use



37
# File 'lib/mongo_tanker.rb', line 37

mattr_accessor :background_engine

#default_indexObject

Default index name (default: Rails.env)



19
# File 'lib/mongo_tanker.rb', line 19

mattr_accessor :default_index

#index_keyObject

Unique indexing key This is used for development and/or shared environments that may be writing to the same single index. This way, you can index the data with a unique key that can be used to retrive that data as well



26
# File 'lib/mongo_tanker.rb', line 26

mattr_accessor :index_key

#private_urlObject

Private Index Tank URL



15
# File 'lib/mongo_tanker.rb', line 15

mattr_accessor :private_url

#public_urlObject

Public Index Tank URL



11
# File 'lib/mongo_tanker.rb', line 11

mattr_accessor :public_url

#queue_nameObject

Queue Name to use (default is nil - default of the engine)



41
# File 'lib/mongo_tanker.rb', line 41

mattr_accessor :queue_name

#run_in_the_backgroundObject

Process in the background? If you are running Sidekiq, setting this value to true will run workers push updates to your indexes. If set to false, then standard callbacks will be used on your models instead.



33
# File 'lib/mongo_tanker.rb', line 33

mattr_accessor :run_in_the_background