Class: JSONAPIonify::Types::TimeStringType
- Inherits:
-
StringType
- Object
- BaseType
- StringType
- JSONAPIonify::Types::TimeStringType
- Defined in:
- lib/jsonapionify/types/time_string_type.rb
Instance Attribute Summary
Attributes inherited from BaseType
Instance Method Summary collapse
Methods inherited from BaseType
dumper, #initialize, loader, #name, #not_null!, #not_null?, #to_s
Methods included from Callbacks
Constructor Details
This class inherits a constructor from JSONAPIonify::Types::BaseType
Instance Method Details
#sample(field_name) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/jsonapionify/types/time_string_type.rb', line 14 def sample(field_name) field_name = field_name.to_s if field_name.to_s.end_with?('ed_at') || field_name.include?('start') Faker::Time.backward elsif field_name.include?('end') Faker::Time.forward else Faker::Time.backward end end |