Sha256: 90e8451efca11f28f24a5f23fd68915cfd779100e5fb5eac81d89913c508ff9a
Contents?: true
Size: 391 Bytes
Versions: 1
Compression:
Stored size: 391 Bytes
Contents
unless String.method_defined? :format class String # A nicer alternative to `Kernel#sprintf` and `String#%`. # # @return [String] the formatted string # # @example # 'This is %s!'.format('Sparta') #=> 'This is Sparta!' # # @example # '%d + %d'.format([1, 2]) #=> '1 + 2' def format(*args) super(self, *(args.flatten(1))) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
powerpack-0.0.3 | lib/powerpack/string/format.rb |