Class: FlatKit::FieldType::StringType
- Inherits:
-
FlatKit::FieldType
- Object
- FlatKit::FieldType
- FlatKit::FieldType::StringType
- Defined in:
- lib/flat_kit/field_type/string_type.rb
Overview
Internal: 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, weights
Methods included from DescendantTracker
#children, #find_child, #find_children, #inherited
Class Method Details
.coerce(data) ⇒ Object
17 18 19 20 21 |
# File 'lib/flat_kit/field_type/string_type.rb', line 17 def self.coerce(data) data.to_s rescue StandardError => _e CoerceFailure end |
.matches?(data) ⇒ Boolean
13 14 15 |
# File 'lib/flat_kit/field_type/string_type.rb', line 13 def self.matches?(data) data.is_a?(String) end |
.type_name ⇒ Object
9 10 11 |
# File 'lib/flat_kit/field_type/string_type.rb', line 9 def self.type_name "string" end |