Class: Dynamoid::Associations::BelongsTo

Inherits:
Object
  • Object
show all
Includes:
Association
Defined in:
lib/dynamoid/associations/belongs_to.rb

Instance Attribute Summary

Attributes included from Association

#name, #options, #query, #source

Instance Method Summary (collapse)

Methods included from Association

#<<, #create, #create!, #delete, #delete_all, #destroy_all, #each, #include?, #initialize, #records, #setter, #where

Constructor Details

This class inherits a constructor from Dynamoid::Associations::Association

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(method, *args)

Delegate methods we don't find directly to the target.

Since:

  • 0.2.0



22
23
24
25
26
27
28
# File 'lib/dynamoid/associations/belongs_to.rb', line 22

def method_missing(method, *args)
  if target.respond_to?(method)
    target.send(method, *args)
  else
    super
  end
end

Instance Method Details

- (Boolean) ==(other)

Is this object equal to the association's target?

Returns:

  • (Boolean)

    true/false

Since:

  • 0.2.0



15
16
17
# File 'lib/dynamoid/associations/belongs_to.rb', line 15

def ==(other)
  target == other
end