Class: Arara::ElevationComponent
- Inherits:
-
ActionView::Component::Base
- Object
- ActionView::Component::Base
- Arara::ElevationComponent
- Includes:
- BaseComponent
- Defined in:
- app/components/arara/elevation_component.rb
Instance Attribute Summary collapse
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
Instance Method Summary collapse
- #default_html_class ⇒ Object
-
#initialize(depth:, **kw) ⇒ ElevationComponent
constructor
A new instance of ElevationComponent.
Methods included from BaseComponent
#default_data_controller, #default_html_tag, #html_class, #html_content, #html_data, #html_options, #html_tag, included
Constructor Details
#initialize(depth:, **kw) ⇒ ElevationComponent
Returns a new instance of ElevationComponent.
9 10 11 12 13 |
# File 'app/components/arara/elevation_component.rb', line 9 def initialize(depth:, **kw) super(tag: "div", depth: depth, **kw) @depth = depth end |
Instance Attribute Details
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
7 8 9 |
# File 'app/components/arara/elevation_component.rb', line 7 def depth @depth end |
Instance Method Details
#default_html_class ⇒ Object
15 16 17 |
# File 'app/components/arara/elevation_component.rb', line 15 def default_html_class "mdc-elevation--z#{depth}" end |