Class: Bike::I18n::Msgstr

Inherits:
String
  • Object
show all
Defined in:
lib/_i18n.rb

Instance Method Summary collapse

Instance Method Details

#%(*args) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/_i18n.rb', line 9

def %(*args)
  if args.first.is_a? ::Hash
    self.gsub(/%\{(\w+)\}/) { args.first[$1.intern].to_s }
  else
    args = args.first if args.first.is_a? ::Array
    ::String.new(self.gsub(/%\{(\w+)\}/, '%s')) % args
  end
end