class EacRubyUtils::CustomFormat

A formatter like [String.sprintf].

Constants

SEQUENCE_PATTERN
TYPE_PATTERN

Attributes

mapping[R]

Public Class Methods

new(mapping) click to toggle source
# File lib/eac_ruby_utils/custom_format.rb, line 11
def initialize(mapping)
  @mapping = mapping.map { |k, v| [k.to_sym, v] }.to_h.freeze
end

Public Instance Methods

format(string) click to toggle source
# File lib/eac_ruby_utils/custom_format.rb, line 15
def format(string)
  ::EacRubyUtils::CustomFormat::String.new(self, string)
end