Class: PDC::Resource::Associations::Association

Inherits:
Relation
  • Object
show all
Defined in:
lib/pdc/resource/associations/association.rb

Direct Known Subclasses

HasMany

Instance Attribute Summary collapse

Attributes inherited from Relation

#klass, #params

Instance Method Summary collapse

Methods inherited from Relation

#all!, #count, #each, #find, #uri

Methods included from Pagination

#each_page

Methods included from Finder

#contents!, #find_one!

Methods included from Query

#where

Methods included from Logging

#logger

Constructor Details

#initialize(klass, parent, name, options = {}) ⇒ Association

Returns a new instance of Association.



8
9
10
11
12
# File 'lib/pdc/resource/associations/association.rb', line 8

def initialize(klass, parent, name, options = {})
  super(klass, options)
  @parent = parent
  @name = name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PDC::Resource::Relation

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/pdc/resource/associations/association.rb', line 6

def name
  @name
end

#parentObject (readonly)

Returns the value of attribute parent.



6
7
8
# File 'lib/pdc/resource/associations/association.rb', line 6

def parent
  @parent
end