Module: Plushie::Type::Direction

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

Overview

Orientation for the scrollable direction prop and rule widget.

Examples:

scrollable("content", direction: :vertical)
rule(direction: :horizontal)

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 direction values.

%i[horizontal vertical both].freeze

Class Method Summary collapse

Class Method Details

.encode(value) ⇒ String

Parameters:

  • value (Symbol)

    :horizontal, :vertical, :both

Returns:

  • (String)

Raises:

  • (ArgumentError)


17
18
19
20
# File 'lib/plushie/type/direction.rb', line 17

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