Class: Avo::Fields::Common::KeyValueComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
ApplicationHelper
Defined in:
app/components/avo/fields/common/key_value_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ApplicationHelper

#a_button, #a_link, #button_classes, #card_classes, #chart_color, #decode_filter_params, #empty_state, #encode_filter_params, #frame_id, #get_model_class, #input_classes, #mount_path, #number_to_social, #render_license_warning, #root_path_without_url, #svg, #white_panel_classes

Methods included from ResourcesHelper

#field_wrapper, #filter_wrapper, #index_field_wrapper, #item_select_all_input, #item_selector_init, #item_selector_input, #resource_grid, #resource_table

Constructor Details

#initialize(field:, form: nil, view: "show") ⇒ KeyValueComponent

Returns a new instance of KeyValueComponent.



8
9
10
11
12
# File 'app/components/avo/fields/common/key_value_component.rb', line 8

def initialize(field:, form: nil, view: "show")
  @field = field
  @form = form
  @view = Avo::ViewInquirer.new(view)
end

Instance Attribute Details

#viewObject (readonly)

Returns the value of attribute view.



6
7
8
# File 'app/components/avo/fields/common/key_value_component.rb', line 6

def view
  @view
end