Class: Ap4r::AsyncHelper::Converters::Base
- Defined in:
- lib/ap4r/async_helper.rb
Overview
A base class for converter classes. Responsibilities of subclasses are as folows
-
by
make_params
, convert async_params to appropriate object -
by
make_rm_options
, make appropriateHash
passed byReliableMsg::Queue#put
Direct Known Subclasses
Class Method Summary collapse
-
.dispatch_mode(mode_symbol) ⇒ Object
Difine a constant
DISPATCH_MODE
to value ‘mode_symbol’ and add self to a Converters list.
Instance Method Summary collapse
-
#initialize(url_options, async_params, rm_options, url_for_handler) ⇒ Base
constructor
A new instance of Base.
-
#make_params ⇒ Object
Returns a object which passed to
ReliableMsg::Queue.put(message, headers)
‘s first argumentmessage
. -
#make_rm_options ⇒ Object
Returns a object which passed to
ReliableMsg::Queue.put(message, headers)
‘s second argumentheaders
. -
#queue_name ⇒ Object
Returns a queue name to which a message will be queued.
Constructor Details
#initialize(url_options, async_params, rm_options, url_for_handler) ⇒ Base
Returns a new instance of Base.
205 206 207 208 209 210 |
# File 'lib/ap4r/async_helper.rb', line 205 def initialize(, async_params, , url_for_handler) @url_options = @async_params = async_params @rm_options = @url_for_handler = url_for_handler end |
Class Method Details
.dispatch_mode(mode_symbol) ⇒ Object
Difine a constant DISPATCH_MODE
to value ‘mode_symbol’ and add self to a Converters list.
200 201 202 203 |
# File 'lib/ap4r/async_helper.rb', line 200 def self.dispatch_mode(mode_symbol) self.const_set(:DISPATCH_MODE, mode_symbol) ::Ap4r::AsyncHelper::Base::Converters[mode_symbol] = self end |
Instance Method Details
#make_params ⇒ Object
Returns a object which passed to ReliableMsg::Queue.put(message, headers)
‘s first argument message
. Should be implemented by subclasses.
221 222 223 |
# File 'lib/ap4r/async_helper.rb', line 221 def make_params raise 'must be implemented in subclasses' end |
#make_rm_options ⇒ Object
Returns a object which passed to ReliableMsg::Queue.put(message, headers)
‘s second argument headers
. Should be implemented by subclasses.
228 229 230 |
# File 'lib/ap4r/async_helper.rb', line 228 def raise 'must be implemented in subclasses' end |
#queue_name ⇒ Object
Returns a queue name to which a message will be queued. Should be implemented by subclasses.
214 215 216 |
# File 'lib/ap4r/async_helper.rb', line 214 def queue_name raise 'must be implemented in subclasses' end |