Module: Plushie::Type::Position

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

Overview

Placement value for the tooltip position prop.

Examples:

tooltip("tip", "Helpful text", position: :bottom)

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

%i[top bottom left right follow_cursor].freeze

Class Method Summary collapse

Class Method Details

.encode(value) ⇒ String

Parameters:

  • value (Symbol)

    :top, :bottom, :left, :right, :follow_cursor

Returns:

  • (String)

Raises:

  • (ArgumentError)


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

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