Class: Notifu::Actor
- Includes:
- Util, Sidekiq::Worker
- Defined in:
- lib/notifu/workers/actor.rb
Direct Known Subclasses
Notifu::Actors::GammuSmsBridge, Notifu::Actors::Pagerduty, Notifu::Actors::Slack, Notifu::Actors::Smtp, Notifu::Actors::Stdout, Notifu::Actors::TwilioCall
Class Attribute Summary collapse
-
.desc ⇒ Object
Returns the value of attribute desc.
-
.name ⇒ Object
Returns the value of attribute name.
-
.retry ⇒ Object
Returns the value of attribute retry.
Instance Attribute Summary collapse
-
#contacts ⇒ Object
Returns the value of attribute contacts.
-
#issue ⇒ Object
Returns the value of attribute issue.
Instance Method Summary collapse
-
#act ⇒ Object
‘act` function must be defined in child classes (provides notification actors modularity).
- #load_data(args) ⇒ Object
- #perform(*args) ⇒ Object
Methods included from Util
Class Attribute Details
.desc ⇒ Object
Returns the value of attribute desc.
29 30 31 |
# File 'lib/notifu/workers/actor.rb', line 29 def desc @desc end |
.name ⇒ Object
Returns the value of attribute name.
28 29 30 |
# File 'lib/notifu/workers/actor.rb', line 28 def name @name end |
.retry ⇒ Object
Returns the value of attribute retry.
30 31 32 |
# File 'lib/notifu/workers/actor.rb', line 30 def retry @retry end |
Instance Attribute Details
#contacts ⇒ Object
Returns the value of attribute contacts.
25 26 27 |
# File 'lib/notifu/workers/actor.rb', line 25 def contacts @contacts end |
#issue ⇒ Object
Returns the value of attribute issue.
24 25 26 |
# File 'lib/notifu/workers/actor.rb', line 24 def issue @issue end |
Instance Method Details
#act ⇒ Object
‘act` function must be defined in child classes (provides notification actors modularity)
36 37 38 |
# File 'lib/notifu/workers/actor.rb', line 36 def act exit 1 end |
#load_data(args) ⇒ Object
49 50 51 52 |
# File 'lib/notifu/workers/actor.rb', line 49 def load_data args self.issue = Notifu::Model::Issue.with(:notifu_id, args[0]) self.contacts = args[1].map { |contact| Notifu::Model::Contact.with(:name, contact) } end |
#perform(*args) ⇒ Object
43 44 45 46 47 |
# File 'lib/notifu/workers/actor.rb', line 43 def perform *args sleep 2 load_data args act end |