Class: NotifyApi::CompletedNzb

Inherits:
Object
  • Object
show all
Defined in:
lib/notify/api/completed_nzb.rb

Overview

Announce that a file has been completed

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (CompletedNzb) initialize(notifier = NotifyLibNotify::LibNotify.new)

Set the notification library to use, defaults to libnotify

Parameters:



18
19
20
# File 'lib/notify/api/completed_nzb.rb', line 18

def initialize(notifier = NotifyLibNotify::LibNotify.new)
  self.notifier = notifier
end

Instance Attribute Details

- (String) name

Returns:

  • (String)


8
9
10
# File 'lib/notify/api/completed_nzb.rb', line 8

def name
  @name
end

- (NotifyLibNotify::LibNotify) notifier



14
15
16
# File 'lib/notify/api/completed_nzb.rb', line 14

def notifier
  @notifier
end

- (String) status

Returns:

  • (String)


11
12
13
# File 'lib/notify/api/completed_nzb.rb', line 11

def status
  @status
end

Instance Method Details

- (String) process

Announce the job completion name with the name set in the class Returns the message announced

Returns:

  • (String)

See Also:



29
30
31
32
33
34
35
# File 'lib/notify/api/completed_nzb.rb', line 29

def process
  announce = "Job " + self.name + " " + self.status

  self.notifier.notify(announce)

  return announce
end