Sha256: b7e433815e1d5ffe294933d95231447627767c011b80ee024385f0d886d4093a

Contents?: true

Size: 254 Bytes

Versions: 11

Compression:

Stored size: 254 Bytes

Contents

require 'facets/string/tabto'

class String

  # Aligns each line n spaces.
  #
  # CREDIT: Gavin Sinclair
  #
  def tab(n)
    gsub(/^ */, ' ' * n)
  end

  # NOTE: Deprecated #taballto which was an alias for #tab.
  #alias_method :taballto, :tab

end

Version data entries

11 entries across 10 versions & 1 rubygems

Version Path
facets-2.9.3 lib/core/facets/string/tab.rb
facets-2.9.2 src/core/facets/string/tab.rb
facets-2.9.2 lib/core/facets/string/tab.rb
facets-2.9.1 lib/core/facets/string/tab.rb
facets-2.9.0 lib/core/facets/string/tab.rb
facets-2.9.0.pre.2 lib/core/facets/string/tab.rb
facets-2.9.0.pre.1 lib/core/facets/string/tab.rb
facets-2.8.4 lib/core/facets/string/tab.rb
facets-2.8.3 lib/core/facets/string/tab.rb
facets-2.8.2 lib/core/facets/string/tab.rb
facets-2.8.1 lib/core/facets/string/tab.rb