Class: Formalist::DisplayAdapters::Textarea

Inherits:
Object
  • Object
show all
Defined in:
lib/formalist/display_adapters/textarea.rb

Constant Summary collapse

PERMITTED_TYPES =
%w[
  string
].freeze

Instance Method Summary collapse

Instance Method Details

#call(field) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
# File 'lib/formalist/display_adapters/textarea.rb', line 8

def call(field)
  raise ArgumentError, "field type must be one of #{PERMITTED_TYPES.join(', ')}" unless PERMITTED_TYPES.include?(field.type)
  field.to_display_variant("textarea")
end