Module: PhonyAttribute

Defined in:
lib/phony_attribute.rb,
lib/phony_attribute/railtie.rb,
lib/phony_attribute/version.rb,
lib/phony_attribute/attribute.rb,
lib/phony_attribute/phone_number.rb

Defined Under Namespace

Modules: Attribute Classes: PhoneNumber, Railtie

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.PhoneNumber(value) ⇒ Object



103
104
105
106
107
108
109
110
# File 'lib/phony_attribute/phone_number.rb', line 103

def PhoneNumber(value)
  case value
  when PhoneNumber then value
  when String then PhoneNumber.parse(value)
  else
    nil
  end
end