Class: RestFtpDaemon::Notification

Inherits:
Object
  • Object
show all
Includes:
BmcDaemonLib::LoggerHelper, CommonHelpers
Defined in:
lib/rest-ftp-daemon/notification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CommonHelpers

#dashboard_url, #exception_to_error, #format_bytes, #identifier, #underscore

Constructor Details

#initialize(url, params) ⇒ Notification

Returns a new instance of Notification.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rest-ftp-daemon/notification.rb', line 19

def initialize url, params
  # Remember params
  @url = url
  @params = params

  # Generate a random key
  @id = identifier(NOTIFY_IDENTIFIER_LEN)
  @jid = nil

  # Logger
  log_pipe :notify

  # Handle the notification
  log_info "initialized [#{@url}]"
  process
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



13
14
15
# File 'lib/rest-ftp-daemon/notification.rb', line 13

def error
  @error
end

#jobObject

Returns the value of attribute job.



17
18
19
# File 'lib/rest-ftp-daemon/notification.rb', line 17

def job
  @job
end

#job_idObject

Class options



11
12
13
# File 'lib/rest-ftp-daemon/notification.rb', line 11

def job_id
  @job_id
end

#messageObject

Returns the value of attribute message.



14
15
16
# File 'lib/rest-ftp-daemon/notification.rb', line 14

def message
  @message
end

#signalObject

Returns the value of attribute signal.



12
13
14
# File 'lib/rest-ftp-daemon/notification.rb', line 12

def signal
  @signal
end

#statusObject

Returns the value of attribute status.



15
16
17
# File 'lib/rest-ftp-daemon/notification.rb', line 15

def status
  @status
end

#urlObject

Returns the value of attribute url.



16
17
18
# File 'lib/rest-ftp-daemon/notification.rb', line 16

def url
  @url
end