Sha256: 43d36c5b4e3f8f0dbf8ed11558c9d20777a4e05199d0036d27784a53375659dc

Contents?: true

Size: 879 Bytes

Versions: 8

Compression:

Stored size: 879 Bytes

Contents

module SolidusBling
  class Subscriber
    include Omnes::Subscriber

    handle :order_finalized,
    with: :send_order_to_bling,
    id: :send_order_to_bling

    handle :bling_products_updated,
    with: :products_updated,
    id: :products_updated

    handle :bling_contact_created,
    with: :contato_created,
    id: :contato_created

    def send_order_to_bling event, debug_info = {}
      method = __method__.to_s
      SolidusBling::OrderJob.perform_later(event: event.payload, method_name: method)
    end

    def contato_created event, debug_info = {}
      method = __method__.to_s
      SolidusBling::ContactJob.perform_later(event: event.payload, method_name: method)
    end

    def products_updated event, debug_info = {}
      method = __method__.to_s
      SolidusBling::ProductJob.perform_later(event: event.payload, method_name: method)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
solidus_bling-2.0.7 app/subscribers/solidus_bling/subscriber.rb
solidus_bling-2.0.6 app/subscribers/solidus_bling/subscriber.rb
solidus_bling-2.0.5 app/subscribers/solidus_bling/subscriber.rb
solidus_bling-2.0.4 app/subscribers/solidus_bling/subscriber.rb
solidus_bling-2.0.3 app/subscribers/solidus_bling/subscriber.rb
solidus_bling-2.0.2 app/subscribers/solidus_bling/subscriber.rb
solidus_bling-2.0.1 app/subscribers/solidus_bling/subscriber.rb
solidus_bling-2.0.0 app/subscribers/solidus_bling/subscriber.rb