Class: Alephant::Publisher::SQSHelper::Archiver

Inherits:
Object
  • Object
show all
Defined in:
lib/alephant/publisher/sqs_helper/archiver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cache, async = true) ⇒ Archiver

Returns a new instance of Archiver.



9
10
11
12
# File 'lib/alephant/publisher/sqs_helper/archiver.rb', line 9

def initialize(cache, async = true)
  @async = async
  @cache = cache
end

Instance Attribute Details

#asyncObject (readonly)

Returns the value of attribute async.



7
8
9
# File 'lib/alephant/publisher/sqs_helper/archiver.rb', line 7

def async
  @async
end

#cacheObject (readonly)

Returns the value of attribute cache.



7
8
9
# File 'lib/alephant/publisher/sqs_helper/archiver.rb', line 7

def cache
  @cache
end

Instance Method Details

#see(message) ⇒ Object



14
15
16
17
# File 'lib/alephant/publisher/sqs_helper/archiver.rb', line 14

def see(message)
  return if message.nil?
  message.tap { |m| async ? async_store(m) : store(m) }
end