Class: Typero::TimezoneType
- Defined in:
- lib/typero/type/types/timezone_type.rb
Constant Summary
Constants inherited from Type
Typero::Type::ERRORS, Typero::Type::OPTS, Typero::Type::OPTS_KEYS
Instance Attribute Summary
Attributes inherited from Type
Instance Method Summary collapse
Methods inherited from Type
allowed_opt?, #db_field, db_schema, #default, error, #get, #initialize, load, opts, #value
Constructor Details
This class inherits a constructor from Typero::Type
Instance Method Details
#db_schema ⇒ Object
10 11 12 |
# File 'lib/typero/type/types/timezone_type.rb', line 10 def db_schema [:string, { length: 50 }] end |
#set ⇒ Object
4 5 6 7 8 |
# File 'lib/typero/type/types/timezone_type.rb', line 4 def set TZInfo::Timezone.get(value) rescue TZInfo::InvalidTimezoneIdentifier error_for :invalid_time_zone end |