Module: Mobility::Backend::ClassMethods

Defined in:
lib/mobility/backend.rb

Instance Method Summary collapse

Instance Method Details

#apply_plugin(_) ⇒ Boolean

Note:

This is currently only called by Plugins::Cache.

Called from plugins to apply custom processing for this backend. Name is the name of the plugin.

Parameters:

  • name (Symbol)

    Name of plugin

Returns:

  • (Boolean)

    Whether the plugin was applied



172
173
174
# File 'lib/mobility/backend.rb', line 172

def apply_plugin(_)
  false
end

#for(_) ⇒ self

Attributes uses this method to get a backend class specific to the model using the backend. Backend classes can override this method to return a class specific to the model class using the backend (e.g. either an ActiveRecord or Sequel backend class depending on whether the model is an ActiveRecord model or a Sequel model.)

Returns:

  • (self)

    returns itself

See Also:



163
164
165
# File 'lib/mobility/backend.rb', line 163

def for(_)
  self
end