Class: ActiveRecordEncryption::Quoter
- Inherits:
-
Object
- Object
- ActiveRecordEncryption::Quoter
- Includes:
- ActiveRecord::ConnectionAdapters::Quoting, Singleton
- Defined in:
- lib/active_record_encryption/quoter.rb
Overview
Serialize ruby object to string for encryption.
Instance Method Summary collapse
- #default_timezone ⇒ Symbol
-
#type_cast(value) ⇒ Object
Cast value to string.
-
#unquoted_false ⇒ Object
minimum length of string for encryption.
-
#unquoted_true ⇒ Object
minimum length of string for encryption.
Instance Method Details
#default_timezone ⇒ Symbol
30 31 32 |
# File 'lib/active_record_encryption/quoter.rb', line 30 def default_timezone ActiveRecord::Base.connection.default_timezone end |
#type_cast(value) ⇒ Object
Cast value to string
23 24 25 26 |
# File 'lib/active_record_encryption/quoter.rb', line 23 def type_cast(value) return value.to_s if value.is_a?(Numeric) super(value) end |
#unquoted_false ⇒ Object
minimum length of string for encryption
17 18 19 |
# File 'lib/active_record_encryption/quoter.rb', line 17 def unquoted_false 'f' end |
#unquoted_true ⇒ Object
minimum length of string for encryption
12 13 14 |
# File 'lib/active_record_encryption/quoter.rb', line 12 def unquoted_true 't' end |