Class: Alephant::Publisher::Writer

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/alephant/publisher/writer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, message) ⇒ Writer



20
21
22
23
# File 'lib/alephant/publisher/writer.rb', line 20

def initialize(config, message)
  @config   = config
  @message  = message
end

Instance Attribute Details

#cacheObject (readonly)

Returns the value of attribute cache.



18
19
20
# File 'lib/alephant/publisher/writer.rb', line 18

def cache
  @cache
end

#configObject (readonly)

Returns the value of attribute config.



18
19
20
# File 'lib/alephant/publisher/writer.rb', line 18

def config
  @config
end

#mapperObject (readonly)

Returns the value of attribute mapper.



18
19
20
# File 'lib/alephant/publisher/writer.rb', line 18

def mapper
  @mapper
end

#messageObject (readonly)

Returns the value of attribute message.



18
19
20
# File 'lib/alephant/publisher/writer.rb', line 18

def message
  @message
end

#parserObject (readonly)

Returns the value of attribute parser.



18
19
20
# File 'lib/alephant/publisher/writer.rb', line 18

def parser
  @parser
end

Instance Method Details

#run!Object



45
46
47
# File 'lib/alephant/publisher/writer.rb', line 45

def run!
  batch? ? batch.sequence(message, &perform) : perform.call
end