Class: Brainzlab::Components::Input

Inherits:
Base
  • Object
show all
Defined in:
lib/brainzlab/components/input.rb

Instance Method Summary collapse

Methods inherited from Base

#classes

Constructor Details

#initialize(type: 'text', error: false, **attrs) ⇒ Input

Returns a new instance of Input.



6
7
8
9
10
# File 'lib/brainzlab/components/input.rb', line 6

def initialize(type: 'text', error: false, **attrs)
  @type = type
  @error = error
  @attrs = attrs
end

Instance Method Details

#view_templateObject



12
13
14
15
16
17
18
# File 'lib/brainzlab/components/input.rb', line 12

def view_template
  input(
    type: @type,
    class: input_classes,
    **@attrs
  )
end