Class: S2D::Transports::Prowler

Inherits:
Transport show all
Includes:
Configuration
Defined in:
lib/s2d/transports/prowler.rb

Instance Attribute Summary

Attributes inherited from Transport

#config

Instance Method Summary collapse

Methods inherited from Transport

#to_s

Constructor Details

#initialize(config) ⇒ Prowler

Returns a new instance of Prowler.



6
7
8
9
10
# File 'lib/s2d/transports/prowler.rb', line 6

def initialize(config)
  super(config)
  ::Prowler.logger.level = Logger::WARN
  @prowler = ::Prowler.new(:application => $0, :api_key => config[:api_key])
end

Instance Method Details

#attributesObject

Config wizard uses this information to collect required and optional config parameters



20
21
22
23
24
# File 'lib/s2d/transports/prowler.rb', line 20

def attributes
  [ MandatoryAttribute.new(:api_key, 'API key for prowlapp.com'),
    OptionalAttribute.new(:application, 'Application name to be passed to Prowl', $0),
  ]
end

#deliver(message) ⇒ Object



12
13
14
# File 'lib/s2d/transports/prowler.rb', line 12

def deliver(message)
  @prowler.notify(message.subject, message.body)
end