Class: DbBlaster::BasePublisher
- Inherits:
-
Object
- Object
- DbBlaster::BasePublisher
- Defined in:
- lib/db_blaster/base_publisher.rb
Overview
Base class for publishing
Direct Known Subclasses
Instance Attribute Summary collapse
-
#batch_start_time ⇒ Object
readonly
Returns the value of attribute batch_start_time.
-
#records ⇒ Object
readonly
Returns the value of attribute records.
-
#source_table ⇒ Object
readonly
Returns the value of attribute source_table.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source_table, records, batch_start_time) ⇒ BasePublisher
constructor
A new instance of BasePublisher.
- #publish ⇒ Object
Constructor Details
#initialize(source_table, records, batch_start_time) ⇒ BasePublisher
Returns a new instance of BasePublisher.
9 10 11 12 13 |
# File 'lib/db_blaster/base_publisher.rb', line 9 def initialize(source_table, records, batch_start_time) @source_table = source_table @records = records @batch_start_time = batch_start_time end |
Instance Attribute Details
#batch_start_time ⇒ Object (readonly)
Returns the value of attribute batch_start_time.
7 8 9 |
# File 'lib/db_blaster/base_publisher.rb', line 7 def batch_start_time @batch_start_time end |
#records ⇒ Object (readonly)
Returns the value of attribute records.
7 8 9 |
# File 'lib/db_blaster/base_publisher.rb', line 7 def records @records end |
#source_table ⇒ Object (readonly)
Returns the value of attribute source_table.
7 8 9 |
# File 'lib/db_blaster/base_publisher.rb', line 7 def source_table @source_table end |
Class Method Details
.publish(source_table:, records:, batch_start_time:) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/db_blaster/base_publisher.rb', line 15 def self.publish(source_table:, records:, batch_start_time:) publisher_class = if DbBlaster.configuration.sns_topic SnsPublisher else S3Publisher end publisher_class.new(source_table, records, batch_start_time).publish end |
Instance Method Details
#publish ⇒ Object
25 26 27 |
# File 'lib/db_blaster/base_publisher.rb', line 25 def publish raise NotImplementedError end |