Class: Mobility::Plugins::Backend::MobilityBackends

Inherits:
Hash
  • Object
show all
Defined in:
lib/mobility/plugins/backend.rb

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ MobilityBackends

Returns a new instance of MobilityBackends.



118
119
120
121
# File 'lib/mobility/plugins/backend.rb', line 118

def initialize(model)
  @model = model
  super()
end

Instance Method Details

#[](name) ⇒ Object



123
124
125
126
127
# File 'lib/mobility/plugins/backend.rb', line 123

def [](name)
  return fetch(name) if has_key?(name)
  return self[name.to_sym] if String === name
  self[name] = @model.class.mobility_backend_class(name).new(@model, name.to_s)
end

#marshal_dumpObject



129
130
131
# File 'lib/mobility/plugins/backend.rb', line 129

def marshal_dump
  @model
end

#marshal_load(model) ⇒ Object



133
134
135
# File 'lib/mobility/plugins/backend.rb', line 133

def marshal_load(model)
  @model = model
end