class FlatKit::FieldType::UnknownType

Constants

REGEX

Public Class Methods

coerce(data) click to toggle source
# File lib/flat_kit/field_type/unknown_type.rb, line 17
def self.coerce(data)
  return data if REGEX.match?(data)
  return CoerceFailure
rescue
  return CoerceFailure
end
matches?(data) click to toggle source
# File lib/flat_kit/field_type/unknown_type.rb, line 11
def self.matches?(data)
  return false unless data.kind_of?(String)
  return true if data.length == 0
  return REGEX.match?(data)
end
type_name() click to toggle source
# File lib/flat_kit/field_type/unknown_type.rb, line 7
def self.type_name
  "unknown"
end