class Courier::Service::GritterNotice
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/courier/service/gritter_notice.rb, line 3 def initialize raise "No GritterNotices. Add gem 'gritter_notices' to Gemfile." unless defined? GritterNotices super end
Public Instance Methods
deliver!()
click to toggle source
# File lib/courier/service/gritter_notice.rb, line 27 def deliver! # Nothng to do, it's realtime delivered end
message(owner, template, options)
click to toggle source
В локале создается хеш всех параметров принимаемых GritterNotice
template_key:
title: Внимание! text: Ва прошли на новый уровень level: warning image: /images/warning.png
# File lib/courier/service/gritter_notice.rb, line 19 def message(owner, template, options) scope = [:courier, :services, :gritter_notice, :templates] opt = I18n::translate(template.name, :scope=>scope) opt.merge!(options) opt[:text]||=I18n::translate([template.name,:text], opt.merge(:scope=>scope) ) owner.gritter_notice template.name, opt end