Class: Courier::Service::GritterNotice
- Defined in:
- lib/courier/service/gritter_notice.rb
Instance Method Summary collapse
- #deliver! ⇒ Object
-
#initialize ⇒ GritterNotice
constructor
A new instance of GritterNotice.
-
#message(owner, template, options) ⇒ Object
В локале создается хеш всех параметров принимаемых GritterNotice.
Methods inherited from Base
#check_args, config, configure, #deliver_all!, #deliver_message, inherited, #messages, #name, #to_label, #to_s
Constructor Details
#initialize ⇒ GritterNotice
Returns a new instance of GritterNotice.
4 5 6 7 |
# File 'lib/courier/service/gritter_notice.rb', line 4 def initialize raise "No GritterNotices. Add gem 'gritter_notices' to Gemfile." unless defined? GritterNotices super end |
Instance Method Details
#deliver! ⇒ Object
28 29 30 |
# File 'lib/courier/service/gritter_notice.rb', line 28 def deliver! # Nothng to do, it's realtime delivered end |
#message(owner, template, options) ⇒ Object
В локале создается хеш всех параметров принимаемых GritterNotice
template_key:
title: Внимание!
text: Ва прошли на новый уровень
level: warning
image: /images/warning.png
20 21 22 23 24 25 26 |
# File 'lib/courier/service/gritter_notice.rb', line 20 def (owner, template, ) scope = [:courier, :services, :gritter_notice, :templates] opt = I18n::translate(template.name, :scope=>scope) opt.merge!() opt[:text]||=I18n::translate([template.name,:text], opt.merge(:scope=>scope) ) owner.gritter_notice template.name, opt end |