Class: Announce::Adapters::BaseAdapter::Destination
- Inherits:
-
Object
- Object
- Announce::Adapters::BaseAdapter::Destination
- Defined in:
- lib/announce/adapters/base_adapter.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#options ⇒ Object
Returns the value of attribute options.
-
#subject ⇒ Object
Returns the value of attribute subject.
Class Method Summary collapse
- .app ⇒ Object
- .delimiter ⇒ Object
- .name_for(subject, action) ⇒ Object
- .namespace ⇒ Object
- .prefix ⇒ Object
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(subject, action, options = {}) ⇒ Destination
constructor
A new instance of Destination.
- #name(subject = @subject, action = @action) ⇒ Object
- #publish(message, options = {}) ⇒ Object
- #verify ⇒ Object
Constructor Details
#initialize(subject, action, options = {}) ⇒ Destination
Returns a new instance of Destination.
77 78 79 80 81 |
# File 'lib/announce/adapters/base_adapter.rb', line 77 def initialize(subject, action, = {}) @subject = subject @action = action = || {} end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
59 60 61 |
# File 'lib/announce/adapters/base_adapter.rb', line 59 def action @action end |
#options ⇒ Object
Returns the value of attribute options.
59 60 61 |
# File 'lib/announce/adapters/base_adapter.rb', line 59 def end |
#subject ⇒ Object
Returns the value of attribute subject.
59 60 61 |
# File 'lib/announce/adapters/base_adapter.rb', line 59 def subject @subject end |
Class Method Details
.app ⇒ Object
95 96 97 |
# File 'lib/announce/adapters/base_adapter.rb', line 95 def self.app ::Announce.[:app_name] end |
.delimiter ⇒ Object
91 92 93 |
# File 'lib/announce/adapters/base_adapter.rb', line 91 def self.delimiter ::Announce.[:queue_name_delimiter] end |
.name_for(subject, action) ⇒ Object
73 74 75 |
# File 'lib/announce/adapters/base_adapter.rb', line 73 def self.name_for(subject, action) [prefix, namespace, subject, action].join(delimiter) end |
.namespace ⇒ Object
99 100 101 |
# File 'lib/announce/adapters/base_adapter.rb', line 99 def self.namespace ::Announce.[:namespace] end |
.prefix ⇒ Object
87 88 89 |
# File 'lib/announce/adapters/base_adapter.rb', line 87 def self.prefix ::Announce.[:queue_name_prefix] end |
Instance Method Details
#create ⇒ Object
65 66 67 |
# File 'lib/announce/adapters/base_adapter.rb', line 65 def create raise NotImplementedError.new("You must implement create.") end |
#name(subject = @subject, action = @action) ⇒ Object
83 84 85 |
# File 'lib/announce/adapters/base_adapter.rb', line 83 def name(subject = @subject, action = @action) self.class.name_for(subject, action) end |
#publish(message, options = {}) ⇒ Object
61 62 63 |
# File 'lib/announce/adapters/base_adapter.rb', line 61 def publish(, = {}) raise NotImplementedError.new("You must implement publish.") end |
#verify ⇒ Object
69 70 71 |
# File 'lib/announce/adapters/base_adapter.rb', line 69 def verify raise NotImplementedError.new("You must implement verify.") end |