Module: Mobility::Backends::KeyValue::ClassMethods

Defined in:
lib/mobility/backends/key_value.rb

Backend Configuration collapse

Instance Method Details

#apply_plugin(name) ⇒ Object

Apply custom processing for plugin



96
97
98
99
100
101
102
103
# File 'lib/mobility/backends/key_value.rb', line 96

def apply_plugin(name)
  if name == :cache
    include self::Cache
    true
  else
    super
  end
end

#configure(options) ⇒ Object

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (options):

  • type (Symbol, String) — default: :text

    Column type to use

Raises:

  • (ArgumentError)

    if type is not either :text or :string



88
89
90
91
# File 'lib/mobility/backends/key_value.rb', line 88

def configure(options)
  options[:type] = (options[:type] || :text).to_sym
  raise ArgumentError, "type must be one of: [text, string]" unless [:text, :string].include?(options[:type])
end