Module: KaveRestApi::NumberHelper

Included in:
Integer
Defined in:
lib/kavenegar-ruby/helpers/convertor.rb,
lib/kavenegar-ruby/helpers/validator.rb

Instance Method Summary collapse

Instance Method Details

#ctpdObject



4
5
6
# File 'lib/kavenegar-ruby/helpers/convertor.rb', line 4

def ctpd
    return self.to_s.tr('0123456789','۰١۲۳۴۵۶۷۸۹')
end

#is_phone?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/kavenegar-ruby/helpers/validator.rb', line 5

def is_phone?
    return !!self.match(/^(09{1})+([1-3]{1})+(\d{8})$/)
end