class Fog::Associations::OneModel
Fog Single Association¶ ↑
This class handles single association between the models. It expects the provider to map the attribute with an initialized object.
Public Instance Methods
create_getter()
click to toggle source
# File lib/fog/core/associations/one_model.rb, line 16 def create_getter model.class_eval <<-EOS, __FILE__, __LINE__ def #{name} associations[:#{name}] end EOS end
create_setter()
click to toggle source
# File lib/fog/core/associations/one_model.rb, line 8 def create_setter model.class_eval <<-EOS, __FILE__, __LINE__ def #{name}=(new_#{name}) associations[:#{name}] = new_#{name} end EOS end