Class: MultipleMan::ModelPublisher
- Inherits:
-
Object
- Object
- MultipleMan::ModelPublisher
- Defined in:
- lib/multiple_man/model_publisher.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ModelPublisher
constructor
A new instance of ModelPublisher.
- #publish(records, operation = :create) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ ModelPublisher
Returns a new instance of ModelPublisher.
4 5 6 |
# File 'lib/multiple_man/model_publisher.rb', line 4 def initialize( = {}) self. = end |
Instance Method Details
#publish(records, operation = :create) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/multiple_man/model_publisher.rb', line 8 def publish(records, operation=:create) return unless MultipleMan.configuration.enabled Connection.connect do |connection| all_records(records) do |record| push_record(connection, record, operation) end end end |