Class: Field::Telephone
Instance Attribute Summary
Attributes inherited from Base
#fieldset, #form, #name, #value
Instance Method Summary collapse
Methods inherited from Base
#add_attributes, #form?, #initialize
Constructor Details
This class inherits a constructor from Field::Base
Instance Method Details
#add_validations(klass, options) ⇒ Object
6 7 8 9 10 |
# File 'lib/field/telephone.rb', line 6 def add_validations(klass, ) klass.validates name, telephone: true super end |
#attribute ⇒ Object
12 13 14 |
# File 'lib/field/telephone.rb', line 12 def attribute ::Attribute::Telephone end |
#output ⇒ Object
16 17 18 19 |
# File 'lib/field/telephone.rb', line 16 def output return unless value ::Telephone.new(value).formatted end |