Sha256: c947b8448d53ce814a7628797aa150bf5f1a7ca846dbfa7a7da570987050fdf3

Contents?: true

Size: 987 Bytes

Versions: 7

Compression:

Stored size: 987 Bytes

Contents

== String#align

  require 'facets/string/align'

Align a string to a given position. This method simply delegates
to the other three more specific align methods.

  "xxx".align(:right, 9).assert == "      xxx"
  "xxx".align(:left,  9).assert == "xxx      "

== String#align_right

Align a string to the right. The default alignment separation is
a newline ("\n"). This can be changed as can be the padding string
which defaults to a single space (' ').

  "xxx".align_right(9).assert == "      xxx"

== String#align_left

Align a string to the left. The default alignment separation is a
newline ("\n"). This can be changed as can be the padding string
which defaults to a single space (' ').

  "xxx".align_left(9).assert == "xxx      "

== String#align_center

Centers each line of a string. The default alignment separation is
a new line ("\n"). This can be changed as can be the padding string
which defaults to a single space (' ').

  "xxx".align_center(9).assert == "   xxx   "

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
facets-3.0.0 demo/core/string/align.rdoc
facets-2.9.3 qed/core/string/align.rdoc
facets-2.9.2 qed/core/string/align.rdoc
facets-2.9.1 qed/core/string/align.rdoc
facets-2.9.0 qed/core/string/align.rdoc
facets-2.9.0.pre.2 qed/core/string/align.rdoc
facets-2.9.0.pre.1 qed/core/string/align.rdoc