Class: Valideez::Phone

Inherits:
Base
  • Object
show all
Includes:
Common
Defined in:
lib/valideez/phone.rb

Instance Attribute Summary

Attributes inherited from Base

#val, #validable

Instance Method Summary collapse

Methods included from Common

#validate_format, #validate_length

Methods inherited from Base

#valid?

Constructor Details

#initialize(val, options = {}) ⇒ Phone

Returns a new instance of Phone.



5
6
7
8
9
10
11
12
# File 'lib/valideez/phone.rb', line 5

def initialize(val, options = {})
  super val

  assign({ 
    :mobile => false, 
    :format => /\A\d{9}\Z/, 
  }.merge(options))
end