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.



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

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

Instance Attribute Details

#cacheObject (readonly)

Returns the value of attribute cache.



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

def cache
  @cache
end

#configObject (readonly)

Returns the value of attribute config.



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

def config
  @config
end

#mapperObject (readonly)

Returns the value of attribute mapper.



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

def mapper
  @mapper
end

#messageObject (readonly)

Returns the value of attribute message.



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

def message
  @message
end

#parserObject (readonly)

Returns the value of attribute parser.



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

def parser
  @parser
end

Instance Method Details

#run!Object



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

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