Class: Ripple::Associations::OneStoredKeyProxy

Inherits:
Proxy show all
Includes:
One
Defined in:
lib/ripple/associations/one_stored_key_proxy.rb

Instance Attribute Summary

Attributes inherited from Proxy

#owner, #reflection, #target

Instance Method Summary collapse

Methods included from One

#to_a

Methods included from Instantiators

#build, #create, #create!

Methods inherited from Proxy

#===, #blank?, #has_changed_documents?, #initialize, #inspect, #loaded, #loaded?, #loaded_documents, #nil?, #present?, #proxy_respond_to?, #reload, #reset, #respond_to?, #send

Constructor Details

This class inherits a constructor from Ripple::Associations::Proxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ripple::Associations::Proxy

Instance Method Details

#replace(value) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ripple/associations/one_stored_key_proxy.rb', line 9

def replace(value)
  @reflection.verify_type!(value, owner)

  if value
    assign_key(value.key)
  else
    assign_key(nil)
  end

  @target = value
  loaded
end