Class: Yattho::Forms::Group

Inherits:
BaseComponent show all
Defined in:
lib/yattho/forms/group.rb

Overview

:nodoc:

Constant Summary collapse

VERTICAL =
:vertical
HORIZONTAL =
:horizontal
DEFAULT_LAYOUT =
VERTICAL
LAYOUTS =
[VERTICAL, HORIZONTAL].freeze

Instance Attribute Summary

Attributes included from ActsAsComponent

#template_root_path

Instance Method Summary collapse

Methods inherited from BaseComponent

#content, inherited, #input?, #perform_render, #render?, #to_component, #type

Methods included from ActsAsComponent

#compile!, extended, #renders_templates

Methods included from ClassNameHelper

#class_names

Constructor Details

#initialize(inputs:, builder:, form:, layout: DEFAULT_LAYOUT, **system_arguments) ⇒ Group

Returns a new instance of Group.



14
15
16
17
18
19
20
# File 'lib/yattho/forms/group.rb', line 14

def initialize(inputs:, builder:, form:, layout: DEFAULT_LAYOUT, **system_arguments)
  @inputs = inputs
  @builder = builder
  @form = form
  @layout = layout
  @system_arguments = system_arguments
end

Instance Method Details

#horizontal?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/yattho/forms/group.rb', line 22

def horizontal?
  @layout == HORIZONTAL
end