Class: Savon::Hooks::Hook
- Inherits:
-
Object
- Object
- Savon::Hooks::Hook
- Defined in:
- lib/savon/hooks/hook.rb
Overview
Savon::Hooks::Hook
A hook used somewhere in the system.
Constant Summary collapse
- HOOKS =
[ # Replaces the POST request executed to call a service. # See: Savon::SOAP::Request#response # # Receives the <tt>Savon::SOAP::Request</tt> and is expected to return an <tt>HTTPI::Response</tt>. # It can change the request and return something falsy to still execute the POST request. :soap_request ]
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#hook ⇒ Object
Returns the value of attribute hook.
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
-
#call(*args) ⇒ Object
Calls the
block
with the givenargs
. -
#initialize(id, hook, &block) ⇒ Hook
constructor
Expects an
id
, the name of thehook
to use and ablock
to be called.
Constructor Details
#initialize(id, hook, &block) ⇒ Hook
Expects an id
, the name of the hook
to use and a block
to be called.
21 22 23 24 25 |
# File 'lib/savon/hooks/hook.rb', line 21 def initialize(id, hook, &block) self.id = id self.hook = hook self.block = block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
27 28 29 |
# File 'lib/savon/hooks/hook.rb', line 27 def block @block end |
#hook ⇒ Object
Returns the value of attribute hook.
27 28 29 |
# File 'lib/savon/hooks/hook.rb', line 27 def hook @hook end |
#id ⇒ Object
Returns the value of attribute id.
27 28 29 |
# File 'lib/savon/hooks/hook.rb', line 27 def id @id end |
Instance Method Details
#call(*args) ⇒ Object
Calls the block
with the given args
.
30 31 32 |
# File 'lib/savon/hooks/hook.rb', line 30 def call(*args) block.call(*args) end |