Class: ObjectJSONMapper::Associations::Registry

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/object_json_mapper/associations/registry.rb

Overview

Collection of model associations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistry

Returns a new instance of Registry.



14
15
16
# File 'lib/object_json_mapper/associations/registry.rb', line 14

def initialize
  @associations = []
end

Instance Attribute Details

#associationsObject (readonly)

Returns the value of attribute associations.



7
8
9
# File 'lib/object_json_mapper/associations/registry.rb', line 7

def associations
  @associations
end

Instance Method Details

#find(name) ⇒ ObjectJSONMapper::Associations::Association

Parameters:

  • name (Symbol)

Returns:



20
21
22
# File 'lib/object_json_mapper/associations/registry.rb', line 20

def find(name)
  associations.find { |a| a.name == name }
end