Class: HakumiComponents::Progress::ControllerLocalsParser

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
app/components/hakumi_components/progress/controller_locals_parser.rb

Constant Summary collapse

DisplaySize =
T.type_alias { T.nilable(BaseComponent::SizeValue) }
StrokeGradient =
T.type_alias { T::Hash[String, String] }
StrokeColor =
T.type_alias { T.nilable(T.any(String, StrokeGradient)) }
TooltipOptionsMap =
T.type_alias { T::Hash[Types::HtmlKey, Types::HtmlPrimitive] }

Class Method Summary collapse

Class Method Details

.call(params) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/components/hakumi_components/progress/controller_locals_parser.rb', line 18

def call(params)
  {
    percent: parse_number(html_param(params, :percent)),
    success_percent: parse_number(html_param(params, :success_percent)),
    type: symbol_html_param(html_param(params, :type)),
    status: symbol_html_param(html_param(params, :status)),
    show_info: boolean_html_param(html_param(params, :show_info)),
    size: parse_size(html_param(params, :size)),
    stroke_width: parse_number(html_param(params, :stroke_width)),
    stroke_color: parse_stroke_color(html_param(params, :stroke_color)),
    trail_color: string_html_param(html_param(params, :trail_color)),
    stroke_linecap: symbol_html_param(html_param(params, :stroke_linecap)),
    steps: integer_html_param(html_param(params, :steps)),
    gap_degree: parse_number(html_param(params, :gap_degree)),
    gap_position: symbol_html_param(html_param(params, :gap_position)),
    format: string_html_param(html_param(params, :format)),
    info_tooltip: html_primitive_param(html_param(params, :info_tooltip)),
    info_tooltip_threshold: parse_number(html_param(params, :info_tooltip_threshold)),
    info_tooltip_options: parse_tooltip_options(html_param(params, :info_tooltip_options))
  }.compact
end