Class: AlMail

Inherits:
AlText show all
Defined in:
lib/al_form.rb

Overview

メールアドレス入力ウィジェット

Instance Attribute Summary

Attributes inherited from AlText

#max, #min, #validator

Attributes inherited from AlWidget

#filter, #foreign, #hidden, #label, #message, #name, #required, #tag_attr, #tag_type, #value

Instance Method Summary collapse

Methods inherited from AlText

#set_value, #validate

Methods inherited from AlWidget

#make_tag, #make_value, #set_attr, #set_value

Constructor Details

#initialize(name, arg = {}) ⇒ AlMail

(AlMail) constructor

Parameters:

  • name (String)

    ウィジェット識別名 英文字を推奨

  • arg (Hash) (defaults to: {})

    引数ハッシュ

See Also:



1341
1342
1343
1344
1345
1346
1347
# File 'lib/al_form.rb', line 1341

def initialize( name, arg = {} )
  part = %r([a-zA-Z0-9_\#!$%&`'*+\-{|}~^/=?\.]+)

  super( name, arg )
  @filter = arg[:filter] || AlForm::FILTER_STRIP
  @validator = %r(\A#{part}@#{part}\z)
end