Sha256: 94cc7c5b60df6fb3c9aaefc362207db8d9ecebb6821ddc4a69e5e4c6a2529c34
Contents?: true
Size: 375 Bytes
Versions: 15
Compression:
Stored size: 375 Bytes
Contents
# frozen_string_literal: true module AnnotateRb module Helper class << self def width(string) string.chars.inject(0) { |acc, elem| acc + ((elem.bytesize == 3) ? 2 : 1) } end # TODO: Find another implementation that doesn't depend on ActiveSupport def fallback(*args) args.compact.detect(&:present?) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems