Class: Vx::Lib::Consumer::Params
- Inherits:
-
Struct
- Object
- Struct
- Vx::Lib::Consumer::Params
- Defined in:
- lib/vx/lib/consumer/params.rb
Instance Attribute Summary collapse
-
#ack ⇒ Object
Returns the value of attribute ack.
-
#consumer_class ⇒ Object
Returns the value of attribute consumer_class.
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#exchange_name ⇒ Object
Returns the value of attribute exchange_name.
-
#exchange_options ⇒ Object
Returns the value of attribute exchange_options.
-
#exchange_type ⇒ Object
Returns the value of attribute exchange_type.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#model ⇒ Object
Returns the value of attribute model.
-
#queue_name ⇒ Object
Returns the value of attribute queue_name.
-
#queue_options ⇒ Object
Returns the value of attribute queue_options.
-
#routing_key ⇒ Object
Returns the value of attribute routing_key.
Instance Method Summary collapse
Instance Attribute Details
#ack ⇒ Object
Returns the value of attribute ack.
10 11 12 |
# File 'lib/vx/lib/consumer/params.rb', line 10 def ack @ack end |
#consumer_class ⇒ Object
Returns the value of attribute consumer_class
4 5 6 |
# File 'lib/vx/lib/consumer/params.rb', line 4 def consumer_class @consumer_class end |
#content_type ⇒ Object
Returns the value of attribute content_type.
9 10 11 |
# File 'lib/vx/lib/consumer/params.rb', line 9 def content_type @content_type end |
#exchange_name ⇒ Object
Returns the value of attribute exchange_name.
6 7 8 |
# File 'lib/vx/lib/consumer/params.rb', line 6 def exchange_name @exchange_name end |
#exchange_options ⇒ Object
Returns the value of attribute exchange_options.
6 7 8 |
# File 'lib/vx/lib/consumer/params.rb', line 6 def end |
#exchange_type ⇒ Object
Returns the value of attribute exchange_type.
11 12 13 |
# File 'lib/vx/lib/consumer/params.rb', line 11 def exchange_type @exchange_type end |
#headers ⇒ Object
Returns the value of attribute headers.
8 9 10 |
# File 'lib/vx/lib/consumer/params.rb', line 8 def headers @headers end |
#model ⇒ Object
Returns the value of attribute model.
12 13 14 |
# File 'lib/vx/lib/consumer/params.rb', line 12 def model @model end |
#queue_name ⇒ Object
Returns the value of attribute queue_name.
7 8 9 |
# File 'lib/vx/lib/consumer/params.rb', line 7 def queue_name @queue_name end |
#queue_options ⇒ Object
Returns the value of attribute queue_options.
7 8 9 |
# File 'lib/vx/lib/consumer/params.rb', line 7 def end |
#routing_key ⇒ Object
Returns the value of attribute routing_key.
8 9 10 |
# File 'lib/vx/lib/consumer/params.rb', line 8 def routing_key @routing_key end |
Instance Method Details
#bind_options ⇒ Object
46 47 48 49 50 51 |
# File 'lib/vx/lib/consumer/params.rb', line 46 def opts = { } opts.merge!(routing_key: routing_key) if routing_key opts.merge!(headers: headers) if headers opts end |
#consumer_id ⇒ Object
57 58 59 60 61 62 63 64 65 |
# File 'lib/vx/lib/consumer/params.rb', line 57 def consumer_id @consumer_id ||= consumer_name.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase. gsub("_consumer$", '') end |
#consumer_name ⇒ Object
53 54 55 |
# File 'lib/vx/lib/consumer/params.rb', line 53 def consumer_name @consumer_name ||= consumer_class.to_s end |
#publish_options ⇒ Object
42 43 44 |
# File 'lib/vx/lib/consumer/params.rb', line 42 def config. end |