public Method

Format.split_rules=(s)

Specifies the split mode; used only when #hard_margins is set to true. Allowable values are:

SPLIT_FIXED
The word will be split at the number of characters needed, with no marking at all.
repre
senta
ion
SPLIT_CONTINUATION
The word will be split at the number of characters needed, with a C-style continuation character.
repr\
esen\
tati\
on
SPLIT_HYPHENATION
The word will be split according to the hyphenator specified in #hyphenator. If there is no #hyphenator specified, works like SPLIT_CONTINUATION. The example is using TeX::Hyphen as the #hyphenator.
rep-
re-
sen-
ta-
tion

These values can be bitwise ORed together (e.g., SPLIT_FIXED | SPLIT_CONTINUATION) to provide fallback split methods. In the example given, an attempt will be made to split the word using the rules of SPLIT_CONTINUATION; if there is not enough room, the word will be split with the rules of SPLIT_FIXED. These combinations are also available as the following values:

Default:Text::Format::SPLIT_FIXED
Used in:#format, #paragraphs

Source Code

# File action_mailer/vendor/text-format-0.6.3/text/format.rb, line 415
def split_rules=(s)
  raise ArgumentError, "Invalid value provided for split_rules." if ((s < SPLIT_FIXED) || (s > SPLIT_ALL))
  @split_rules = s
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.