Sha256: 10e552ec21b81ce494e08cc80de7c407873c6a0bd30e76bfe691c512b924ca08

Contents?: true

Size: 503 Bytes

Versions: 2

Compression:

Stored size: 503 Bytes

Contents

# encoding: utf-8
#
# This file is part of the bovem gem. Copyright (C) 2013 and above Shogun <shogun@cowtech.it>.
# Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/mit.
#

module Bovem
  # Extension of Lazier::I18n to support method based access.
  class I18n < ::Lazier::I18n
    private

    def method_missing(method, *args)
      rv = send(:t, method)
      rv = sprintf(rv, *args) if rv.index(/%([\d.]*)[sdf]/) && args.present?
      rv
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bovem-4.0.3 lib/bovem/i18n.rb
bovem-4.0.2 lib/bovem/i18n.rb