class Udongo::Notification
Public Class Methods
new(notice)
click to toggle source
# File lib/udongo/notification.rb, line 2 def initialize(notice) @notice = notice end
Public Instance Methods
build_hash(actor)
click to toggle source
# File lib/udongo/notification.rb, line 6 def build_hash(actor) { actor: I18n.t("b.#{actor}") } end
label()
click to toggle source
# File lib/udongo/notification.rb, line 10 def label "b.msg.#{@notice}" end
translate(vars = nil)
click to toggle source
# File lib/udongo/notification.rb, line 14 def translate(vars = nil) return I18n.t(label) if vars.blank? vars = build_hash(vars) unless vars.is_a?(Hash) I18n.t(label, vars) end