Sha256: 622ad78f66fe49a1dececccbbc4b822f7b1a8a30c7538f61baa42a2a0a903943
Contents?: true
Size: 704 Bytes
Versions: 25
Compression:
Stored size: 704 Bytes
Contents
require 'active_support/core_ext/string/filters' require 'active_support/inflector/transliterate' module Brcobranca # Métodos auxiliares de formatação de strings module FormatacaoString # Formata o tamanho da string # para o tamanho passado # se a string for menor, adiciona espacos a direita # se a string for maior, trunca para o num. de caracteres # def format_size(size) if self.size > size ActiveSupport::Inflector.transliterate(truncate(size, omission: '')) else ActiveSupport::Inflector.transliterate(ljust(size, ' ')) end end end end [String].each do |klass| klass.class_eval { include Brcobranca::FormatacaoString } end
Version data entries
25 entries across 25 versions & 1 rubygems