Skip to content

Commit

Permalink
Rather than duplicate methods, just use delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
seejohnrun committed Sep 28, 2020
1 parent ea51fe1 commit 66f1d79
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/ice_cube/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ module I18n

LOCALES_PATH = File.expand_path(File.join('..', '..', '..', 'config', 'locales'), __FILE__)

def self.t(*args, **kwargs)
backend.t(*args, **kwargs)
end

def self.l(*args, **kwargs)
backend.l(*args, **kwargs)
class << self
delegate :t, :l, to: :backend

This comment has been minimized.

Copy link
@fwininger

fwininger Jan 12, 2021

Contributor

delegate is a rails method not a native ruby method and the gem does'nt have rails dependency

end

def self.backend
Expand Down

0 comments on commit 66f1d79

Please sign in to comment.