Module: Mobility::Attributes::InstanceMethods

Defined in:
lib/mobility/attributes.rb

Instance Method Summary collapse

Instance Method Details

#initialize_dup(other) ⇒ Object


264
265
266
267
# File 'lib/mobility/attributes.rb', line 264

def initialize_dup(other)
  @mobility_backends = nil
  super
end

#mobility_backendsHash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return a new backend for an attribute name.

Returns:

  • (Hash)

    Hash of attribute names and backend instances


257
258
259
260
261
262
# File 'lib/mobility/attributes.rb', line 257

def mobility_backends
  @mobility_backends ||= Hash.new do |hash, name|
    next hash[name.to_sym] if String === name
    hash[name] = self.class.mobility_backend_class(name).new(self, name.to_s)
  end
end