Module: IngramMicroEngine
- Defined in:
- lib/ingram_micro_engine.rb,
lib/ingram_micro_engine/engine.rb,
lib/ingram_micro_engine/version.rb,
app/helpers/ingram_micro_engine/application_helper.rb,
app/controllers/ingram_micro_engine/webhook_controller.rb
Defined Under Namespace
Modules: ApplicationHelper Classes: Engine, Namespace, NotificationAdapter, WebhookController
Constant Summary collapse
- VERSION =
"0.0.3"
Class Attribute Summary collapse
-
.adapter ⇒ Object
Returns the value of attribute adapter.
-
.backend ⇒ Object
Returns the value of attribute backend.
-
.configuration ⇒ Object
Returns the value of attribute configuration.
-
.namespace ⇒ Object
Returns the value of attribute namespace.
Class Method Summary collapse
- .all(callable = Proc.new) ⇒ Object
- .instrument(transaction_name, xml) ⇒ Object
- .log(message) ⇒ Object
- .subscribe(transaction_name, callable = Proc.new) ⇒ Object
Class Attribute Details
.adapter ⇒ Object
Returns the value of attribute adapter.
6 7 8 |
# File 'lib/ingram_micro_engine.rb', line 6 def adapter @adapter end |
.backend ⇒ Object
Returns the value of attribute backend.
6 7 8 |
# File 'lib/ingram_micro_engine.rb', line 6 def backend @backend end |
.configuration ⇒ Object
Returns the value of attribute configuration.
6 7 8 |
# File 'lib/ingram_micro_engine.rb', line 6 def configuration @configuration end |
.namespace ⇒ Object
Returns the value of attribute namespace.
6 7 8 |
# File 'lib/ingram_micro_engine.rb', line 6 def namespace @namespace end |
Class Method Details
.all(callable = Proc.new) ⇒ Object
26 27 28 |
# File 'lib/ingram_micro_engine.rb', line 26 def all(callable=Proc.new) subscribe nil, callable end |
.instrument(transaction_name, xml) ⇒ Object
18 19 20 |
# File 'lib/ingram_micro_engine.rb', line 18 def instrument(transaction_name, xml) backend.instrument namespace.call(transaction_name), xml end |
.log(message) ⇒ Object
12 13 14 15 16 |
# File 'lib/ingram_micro_engine.rb', line 12 def log() if configuration.debug configuration.logger.info "[IngramMicroEngine] #{}" end end |
.subscribe(transaction_name, callable = Proc.new) ⇒ Object
22 23 24 |
# File 'lib/ingram_micro_engine.rb', line 22 def subscribe(transaction_name, callable = Proc.new) backend.subscribe namespace.to_regexp(transaction_name), adapter.call(callable) end |