Class: Integrity::Notifier::Prowl

Inherits:
Notifier::Base
  • Object
show all
Defined in:
lib/integrity/notifier/prowl.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/integrity/notifier/prowl.rb', line 7

def config
  @config
end

Class Method Details

.to_hamlObject



9
10
11
# File 'lib/integrity/notifier/prowl.rb', line 9

def self.to_haml
  File.read(File.dirname(__FILE__) + '/config.haml')
end

Instance Method Details

#deliver!Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/integrity/notifier/prowl.rb', line 13

def deliver!
  if api_keys = config['api_keys']
    api_keys.split(',').each do |key|
      prowl_params = {}
      prowl_params[:application]  = 'Integrity'
      prowl_params[:event]        = short_message
      prowl_params[:description]  = full_message

      ::Prowl.add(key, prowl_params)
    end
  end
end

#to_sObject



26
27
28
# File 'lib/integrity/notifier/prowl.rb', line 26

def to_s
  'Prowl'
end