Module: Plushie::Type::Anchor

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

Overview

Anchor values for the scrollbar alignment prop.

Examples:

scrollable("list", anchor: :end)

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

%i[start end].freeze

Class Method Summary collapse

Class Method Details

.encode(value) ⇒ String

Parameters:

  • value (Symbol)

    :start, :end

Returns:

  • (String)

Raises:

  • (ArgumentError)


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

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