Module: Spree::Webhooks

Defined in:
lib/spree/core/webhooks.rb

Class Method Summary collapse

Class Method Details

.disable_webhooksObject



3
4
5
6
7
8
9
# File 'lib/spree/core/webhooks.rb', line 3

def self.disable_webhooks
  prev_value = disabled?
  RequestStore.store[:disable_spree_webhooks] = true
  yield
ensure
  RequestStore.store[:disable_spree_webhooks] = prev_value
end

.disabled=(value) ⇒ Object



17
18
19
# File 'lib/spree/core/webhooks.rb', line 17

def self.disabled=(value)
  RequestStore.store[:disable_spree_webhooks] = value
end

.disabled?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
# File 'lib/spree/core/webhooks.rb', line 11

def self.disabled?
  # rubocop:disable Style/RedundantFetchBlock
  RequestStore.fetch(:disable_spree_webhooks) { false }
  # rubocop:enable Style/RedundantFetchBlock
end