Class: Primer::Alpha::Stack::AlignArg

Inherits:
ResponsiveArg show all
Defined in:
app/components/primer/alpha/stack.rb

Overview

Stack’s align argument. Used internally.

Constant Summary collapse

DEFAULT =
:stretch
OPTIONS =
[
  nil,
  DEFAULT,
  :start,
  :center,
  :end,
  :baseline
].freeze

Constants inherited from ResponsiveArg

ResponsiveArg::BREAKPOINTS

Constants included from FetchOrFallbackHelper

FetchOrFallbackHelper::InvalidValueError

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ResponsiveArg

for, #to_data_attributes

Methods included from FetchOrFallbackHelper

#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?

Constructor Details

#initialize(values) ⇒ AlignArg

Returns a new instance of AlignArg.



65
66
67
# File 'app/components/primer/alpha/stack.rb', line 65

def initialize(values)
  @values = fetch_or_fallback_all(OPTIONS, values, DEFAULT)
end

Instance Attribute Details

#valuesObject (readonly)

Returns the value of attribute values.



54
55
56
# File 'app/components/primer/alpha/stack.rb', line 54

def values
  @values
end

Class Method Details

.arg_nameObject



69
70
71
# File 'app/components/primer/alpha/stack.rb', line 69

def self.arg_name
  :align
end