Method: Mobility::Backend::Sequel::Serialized.configure!

Defined in:
lib/mobility/backend/sequel/serialized.rb

.configure!(options) ⇒ Object

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (options):

  • format (Symbol) — default: :yaml

    Serialization format

Raises:

  • (ArgumentError)

    if a format other than :yaml or :json is passed in


51
52
53
54
55
# File 'lib/mobility/backend/sequel/serialized.rb', line 51

def self.configure!(options)
  options[:format] ||= :yaml
  options[:format] = options[:format].downcase.to_sym
  raise ArgumentError, "Serialized backend only supports yaml or json formats." unless [:yaml, :json].include?(options[:format])
end