Class: Correspondence::With::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/correspondence/with/proxy.rb

Direct Known Subclasses

ManyProxy, OneProxy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root, name, options) ⇒ Proxy

Returns a new instance of Proxy.



6
7
8
9
10
11
12
13
14
# File 'lib/correspondence/with/proxy.rb', line 6

def initialize(root, name, options)
  @root    = root
  @name    = name.to_sym
  @options = options
  @target  = set_target
  @options[:on]    ||= :id
  @options[:using] ||= :find
  create_association
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/correspondence/with/proxy.rb', line 4

def name
  @name
end

#rootObject (readonly)

Returns the value of attribute root.



4
5
6
# File 'lib/correspondence/with/proxy.rb', line 4

def root
  @root
end

#targetObject (readonly)

Returns the value of attribute target.



4
5
6
# File 'lib/correspondence/with/proxy.rb', line 4

def target
  @target
end