Class: Arara::ElevationComponent

Inherits:
ActionView::Component::Base
  • Object
show all
Includes:
BaseComponent
Defined in:
app/components/arara/elevation_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#depthObject (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_classObject



15
16
17
# File 'app/components/arara/elevation_component.rb', line 15

def default_html_class
  "mdc-elevation--z#{depth}"
end