Class: Polaris::FormLayout::ItemComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/polaris/form_layout/item_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(position:, **system_arguments) ⇒ ItemComponent

Returns a new instance of ItemComponent.



4
5
6
7
8
9
10
11
12
13
# File 'app/components/polaris/form_layout/item_component.rb', line 4

def initialize(position:, **system_arguments)
  @position = position

  @system_arguments = system_arguments
  @system_arguments[:tag] = "div"
  @system_arguments[:classes] = class_names(
    @system_arguments[:classes],
    "Polaris-FormLayout__Item"
  )
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



2
3
4
# File 'app/components/polaris/form_layout/item_component.rb', line 2

def position
  @position
end

Instance Method Details

#callObject



15
16
17
# File 'app/components/polaris/form_layout/item_component.rb', line 15

def call
  render(Polaris::BaseComponent.new(**@system_arguments)) { content }
end