Class: Gemometer::Notifiers::Mailgun
- Defined in:
- lib/gemometer/notifiers/mailgun.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts) ⇒ Mailgun
constructor
A new instance of Mailgun.
- #message ⇒ Object
- #url ⇒ Object
- #username ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(opts) ⇒ Mailgun
Returns a new instance of Mailgun.
7 8 9 10 11 |
# File 'lib/gemometer/notifiers/mailgun.rb', line 7 def initialize(opts) @domain = opts[:domain] @to = opts[:to] super(opts) end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
5 6 7 |
# File 'lib/gemometer/notifiers/mailgun.rb', line 5 def domain @domain end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
5 6 7 |
# File 'lib/gemometer/notifiers/mailgun.rb', line 5 def to @to end |
Class Method Details
.mandatory_options ⇒ Object
13 14 15 |
# File 'lib/gemometer/notifiers/mailgun.rb', line 13 def self. [:domain, :to, :key] end |
Instance Method Details
#message ⇒ Object
17 18 19 20 21 |
# File 'lib/gemometer/notifiers/mailgun.rb', line 17 def msg = '<p>Outdated gems:</p><ul>' gems.each { |g| msg += "<li>#{ruby_gems_link(g.name)} #{g.message_line}</li>" } msg += '</ul>' end |
#url ⇒ Object
27 28 29 |
# File 'lib/gemometer/notifiers/mailgun.rb', line 27 def url "https://api.mailgun.net/v3/#{domain}/messages" end |
#username ⇒ Object
23 24 25 |
# File 'lib/gemometer/notifiers/mailgun.rb', line 23 def username 'api' end |