Class: Primer::Alpha::Stack::JustifyArg
- Inherits:
-
ResponsiveArg
- Object
- ResponsiveArg
- Primer::Alpha::Stack::JustifyArg
- Defined in:
- app/components/primer/alpha/stack.rb
Overview
Stack’s justify argument. Used internally.
Constant Summary collapse
- DEFAULT =
:start
- MAPPING =
{ DEFAULT => "start", :center => "center", :end => "end", :space_between => "space-between", :space_evenly => "space-evenly" }.freeze
- OPTIONS =
[nil, *MAPPING.keys.freeze]
Constants inherited from ResponsiveArg
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(values) ⇒ JustifyArg
constructor
A new instance of JustifyArg.
Methods inherited from ResponsiveArg
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Constructor Details
#initialize(values) ⇒ JustifyArg
Returns a new instance of JustifyArg.
22 23 24 25 26 |
# File 'app/components/primer/alpha/stack.rb', line 22 def initialize(values) @values = fetch_or_fallback_all(OPTIONS, values, DEFAULT) do |value| MAPPING[value] end end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
11 12 13 |
# File 'app/components/primer/alpha/stack.rb', line 11 def values @values end |
Class Method Details
.arg_name ⇒ Object
28 29 30 |
# File 'app/components/primer/alpha/stack.rb', line 28 def self.arg_name :justify end |