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

Returns a new instance of Writer.



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

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

Instance Attribute Details

#cacheObject (readonly)

Returns the value of attribute cache.



16
17
18
# File 'lib/alephant/publisher/writer.rb', line 16

def cache
  @cache
end

#configObject (readonly)

Returns the value of attribute config.



16
17
18
# File 'lib/alephant/publisher/writer.rb', line 16

def config
  @config
end

#mapperObject (readonly)

Returns the value of attribute mapper.



16
17
18
# File 'lib/alephant/publisher/writer.rb', line 16

def mapper
  @mapper
end

#messageObject (readonly)

Returns the value of attribute message.



16
17
18
# File 'lib/alephant/publisher/writer.rb', line 16

def message
  @message
end

#parserObject (readonly)

Returns the value of attribute parser.



16
17
18
# File 'lib/alephant/publisher/writer.rb', line 16

def parser
  @parser
end

Instance Method Details

#run!Object



43
44
45
# File 'lib/alephant/publisher/writer.rb', line 43

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