Class: PhlexUI::Input
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(type: :string, error: nil, **attrs) ⇒ Input
constructor
A new instance of Input.
- #view_template ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(type: :string, error: nil, **attrs) ⇒ Input
Returns a new instance of Input.
5 6 7 8 9 |
# File 'lib/phlex_ui/input.rb', line 5 def initialize(type: :string, error: nil, **attrs) @type = type.to_sym @error = error super(**attrs) end |
Instance Method Details
#view_template ⇒ Object
11 12 13 14 |
# File 'lib/phlex_ui/input.rb', line 11 def view_template input(type: @type, **attrs) render PhlexUI::InputError.new { @error } if @error end |