Module: Plushie::Type::Wrapping

Defined in:
lib/plushie/type/wrapping.rb

Overview

Line-break strategy for the text wrapping prop.

Examples:

text("content", long_text, wrapping: :word)

Constant Summary collapse

VALID =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Valid text wrapping modes.

i[none word glyph word_or_glyph].freeze

Class Method Summary collapse

Class Method Details

.encode(value) ⇒ String

Parameters:

  • value (Symbol)

    :none, :word, :glyph, :word_or_glyph

Returns:

  • (String)

Raises:

  • (ArgumentError)


16
17
18
19
# File 'lib/plushie/type/wrapping.rb', line 16

def self.encode(value)
  raise ArgumentError, "invalid wrapping: #{value.inspect}" unless VALID.include?(value)
  value.to_s
end