Class: Notifications::Notification

Inherits:
Object
  • Object
show all
Defined in:
lib/notifications.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(icon: '', body: '', summary: '', hints: {}, timeout: -1,, appname:) ⇒ Notification

Returns a new instance of Notification.



174
175
176
177
178
179
180
181
182
183
# File 'lib/notifications.rb', line 174

def initialize(icon: '', body: '', summary: '', hints: {}, timeout: -1, appname:)
  @actions = ActionList.new
  @icon = icon
  @body = body
  @summary = summary
  @hints = hints
  @timeout = timeout
  @id = nil
  @appname = appname
end

Instance Attribute Details

#actionsObject

Returns the value of attribute actions.



172
173
174
# File 'lib/notifications.rb', line 172

def actions
  @actions
end

#appnameObject

Returns the value of attribute appname.



172
173
174
# File 'lib/notifications.rb', line 172

def appname
  @appname
end

#bodyObject

Returns the value of attribute body.



172
173
174
# File 'lib/notifications.rb', line 172

def body
  @body
end

#hintsObject

Returns the value of attribute hints.



172
173
174
# File 'lib/notifications.rb', line 172

def hints
  @hints
end

#iconObject

Returns the value of attribute icon.



172
173
174
# File 'lib/notifications.rb', line 172

def icon
  @icon
end

#idObject

Returns the value of attribute id.



172
173
174
# File 'lib/notifications.rb', line 172

def id
  @id
end

#summaryObject

Returns the value of attribute summary.



172
173
174
# File 'lib/notifications.rb', line 172

def summary
  @summary
end

#timeoutObject

Returns the value of attribute timeout.



172
173
174
# File 'lib/notifications.rb', line 172

def timeout
  @timeout
end

Instance Method Details

#register_action(action:) ⇒ Object



185
186
187
# File 'lib/notifications.rb', line 185

def register_action(action:)
  @actions << action
end