Class: Arara::TypographyComponent
- Inherits:
-
ActionView::Component::Base
- Object
- ActionView::Component::Base
- Arara::TypographyComponent
- Includes:
- BaseComponent
- Defined in:
- app/components/arara/typography_component.rb
Defined Under Namespace
Classes: InvalidVariant
Constant Summary collapse
- VALID_VARIANTS =
%w(h1 h2 h3 h4 h5 h6 sub1 sub2 body1 body2 button caption overline)
Instance Method Summary collapse
-
#initialize(variant: "body1", **kw) ⇒ TypographyComponent
constructor
A new instance of TypographyComponent.
Methods included from BaseComponent
#default_data_controller, #html_class, #html_content, #html_data, #html_options, included
Constructor Details
#initialize(variant: "body1", **kw) ⇒ TypographyComponent
Returns a new instance of TypographyComponent.
8 9 10 11 |
# File 'app/components/arara/typography_component.rb', line 8 def initialize(variant: "body1", **kw) raise InvalidVariant.new("`#{variant}' is not a valid variant") unless VALID_VARIANTS.include?(variant.to_s) super(variant: variant, **kw) end |