Class: FlatKit::FieldType::StringType
- Inherits:
-
FlatKit::FieldType
- Object
- FlatKit::FieldType
- FlatKit::FieldType::StringType
- Defined in:
- lib/flat_kit/field_type/string_type.rb
Overview
StringType is essentially a fallback - hence its lower weight than other types that might have string representations.
Constant Summary
Constants inherited from FlatKit::FieldType
Class Method Summary collapse
Methods inherited from FlatKit::FieldType
best_guess, candidate_types, weight
Methods included from DescendantTracker
#children, #find_child, #find_children, #inherited
Class Method Details
.coerce(data) ⇒ Object
15 16 17 18 19 |
# File 'lib/flat_kit/field_type/string_type.rb', line 15 def self.coerce(data) data.to_s rescue => _ CoerceFailure end |
.matches?(data) ⇒ Boolean
11 12 13 |
# File 'lib/flat_kit/field_type/string_type.rb', line 11 def self.matches?(data) data.kind_of?(String) end |
.type_name ⇒ Object
7 8 9 |
# File 'lib/flat_kit/field_type/string_type.rb', line 7 def self.type_name "string" end |