Module: BrBoleto::StringMethods
- Defined in:
- lib/br_boleto/string_methods.rb
Instance Method Summary collapse
-
#adjust_size_to(size, adjust = " ") ⇒ Object
para o tamanho passado se a string for menor, adiciona espacos a direita se a string for maior, trunca para o num.
Instance Method Details
#adjust_size_to(size, adjust = " ") ⇒ Object
para o tamanho passado se a string for menor, adiciona espacos a direita se a string for maior, trunca para o num. de caracteres
9 10 11 12 13 14 15 |
# File 'lib/br_boleto/string_methods.rb', line 9 def adjust_size_to(size, adjust=" ") if self.size > size truncate(size, omission: '') else ljust(size, adjust) end end |