Module: Plushie::Type::Shaping

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

Overview

Text shaping strategy for the text shaping prop.

Examples:

text("greeting", "Hello", shaping: :advanced)

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 shaping modes.

%i[basic advanced auto].freeze

Class Method Summary collapse

Class Method Details

.encode(value) ⇒ String

Parameters:

  • value (Symbol)

    :basic, :advanced, :auto

Returns:

  • (String)

Raises:

  • (ArgumentError)


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

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