Class: Tagomatic::TagsProcessingChain

Inherits:
Object
  • Object
show all
Defined in:
lib/tagomatic/tags_processing_chain.rb

Instance Method Summary collapse

Constructor Details

#initialize(options, tags_processor_factory, logger) ⇒ TagsProcessingChain

Returns a new instance of TagsProcessingChain.



5
6
7
8
9
# File 'lib/tagomatic/tags_processing_chain.rb', line 5

def initialize(options, tags_processor_factory, logger)
  @options = options
  @tags_processor_factory = tags_processor_factory
  @logger = logger
end

Instance Method Details

#process!(tags_hash) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/tagomatic/tags_processing_chain.rb', line 11

def process!(tags_hash)
  return if tags_hash.nil? or tags_hash.empty?
  chain = create_processor_chain
  chain.each do |processor|
    tags_hash.merge! processor.process(tags_hash)
  end
end