Class: HakumiComponents::Descriptions::Item::Component

Inherits:
BaseComponent
  • Object
show all
Extended by:
T::Sig
Defined in:
app/components/hakumi_components/descriptions/item/component.rb

Constant Summary

Constants inherited from BaseComponent

BaseComponent::ControllerOptions, BaseComponent::DateInput, BaseComponent::DateLikeValue, BaseComponent::DimensionInput, BaseComponent::HtmlPayloadInput, BaseComponent::I18nOptionValue, BaseComponent::PresenceArray, BaseComponent::PresenceScalar, BaseComponent::PresenceValue, BaseComponent::RawHtmlInput, BaseComponent::SIZES, BaseComponent::SizeValue, BaseComponent::SymbolInput

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseComponent

#append_data_token, boolean_html_param, #build_inline_style, cast_boolean, #cast_boolean, #class_names, #component_classes, #data_attributes_from, #dimension_to_css, #ensure_dom_id!, float_html_param, #generate_id, #html_classes, html_param, html_primitive_param, #html_style, #i18n_scope, integer_html_param, #merge_attributes, #render_value, #size_to_pixels, #stimulus_attrs, string_html_param, string_or_symbol_array_html_param, symbol_html_param, #t_default, #translate_with_default, #validate_inclusion!, #validate_required!, #value_present?

Constructor Details

#initialize(label:, content: nil, span: 1, label_style: nil, content_style: nil, **html_options) ⇒ Component

Returns a new instance of Component.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/components/hakumi_components/descriptions/item/component.rb', line 29

def initialize(
  label:,
  content: nil,
  span: 1,
  label_style: nil,
  content_style: nil,
  **html_options
)
  @label = T.let(label, Types::Renderable)
  @content = T.let(content, Types::Renderable)
  @span = T.let(span, Integer)
  @label_style = T.let(label_style, T.nilable(String))
  @content_style = T.let(content_style, T.nilable(String))
  @html_options = T.let(html_options, Types::HtmlAttributes)
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



11
12
13
# File 'app/components/hakumi_components/descriptions/item/component.rb', line 11

def content
  @content
end

#content_styleObject (readonly)

Returns the value of attribute content_style.



17
18
19
# File 'app/components/hakumi_components/descriptions/item/component.rb', line 17

def content_style
  @content_style
end

#labelObject (readonly)

Returns the value of attribute label.



11
12
13
# File 'app/components/hakumi_components/descriptions/item/component.rb', line 11

def label
  @label
end

#label_styleObject (readonly)

Returns the value of attribute label_style.



17
18
19
# File 'app/components/hakumi_components/descriptions/item/component.rb', line 17

def label_style
  @label_style
end

#spanObject (readonly)

Returns the value of attribute span.



14
15
16
# File 'app/components/hakumi_components/descriptions/item/component.rb', line 14

def span
  @span
end