Class: Backup::Notifier::Presently
- Defined in:
- lib/backup/notifier/presently.rb
Defined Under Namespace
Classes: Client
Instance Attribute Summary collapse
-
#group_id ⇒ Object
Group id.
-
#model ⇒ Object
Container for the Model object.
-
#password ⇒ Object
Presently credentials.
-
#presently_client ⇒ Object
Container for the Presently Client object.
-
#subdomain ⇒ Object
Presently subdomain.
-
#user_name ⇒ Object
Presently credentials.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(&block) ⇒ Presently
constructor
Instantiates a new Backup::Notifier::Presently object.
-
#perform!(model, exception = false) ⇒ Object
Performs the notification Takes an exception object that might’ve been created if an exception occurred.
Methods inherited from Base
Methods included from Configuration::Helpers
#clear_defaults!, #getter_methods, #load_defaults!, #setter_methods
Constructor Details
#initialize(&block) ⇒ Presently
Instantiates a new Backup::Notifier::Presently object
31 32 33 34 35 36 37 |
# File 'lib/backup/notifier/presently.rb', line 31 def initialize(&block) load_defaults! instance_eval(&block) if block_given? set_defaults! end |
Instance Attribute Details
#group_id ⇒ Object
Group id
27 28 29 |
# File 'lib/backup/notifier/presently.rb', line 27 def group_id @group_id end |
#model ⇒ Object
Container for the Model object
15 16 17 |
# File 'lib/backup/notifier/presently.rb', line 15 def model @model end |
#password ⇒ Object
Presently credentials
23 24 25 |
# File 'lib/backup/notifier/presently.rb', line 23 def password @password end |
#presently_client ⇒ Object
Container for the Presently Client object
11 12 13 |
# File 'lib/backup/notifier/presently.rb', line 11 def presently_client @presently_client end |
#subdomain ⇒ Object
Presently subdomain
19 20 21 |
# File 'lib/backup/notifier/presently.rb', line 19 def subdomain @subdomain end |
#user_name ⇒ Object
Presently credentials
23 24 25 |
# File 'lib/backup/notifier/presently.rb', line 23 def user_name @user_name end |
Instance Method Details
#perform!(model, exception = false) ⇒ Object
Performs the notification Takes an exception object that might’ve been created if an exception occurred. If this is the case it’ll invoke notify_failure!(exception), otherwise, if no error was raised, it’ll go ahead and notify_success!
If’ll only perform these if on_success is true or on_failure is true
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/backup/notifier/presently.rb', line 46 def perform!(model, exception = false) @model = model if notify_on_success? and exception.eql?(false) log! notify_success! elsif notify_on_failure? and not exception.eql?(false) log! notify_failure!(exception) end end |