Class: ObjectJSONMapper::Associations::Registry
- Inherits:
-
Object
- Object
- ObjectJSONMapper::Associations::Registry
- Includes:
- Enumerable
- Defined in:
- lib/object_json_mapper/associations/registry.rb
Overview
Collection of model associations
Instance Attribute Summary collapse
-
#associations ⇒ Object
readonly
Returns the value of attribute associations.
Instance Method Summary collapse
- #find(name) ⇒ ObjectJSONMapper::Associations::Association
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
Constructor Details
#initialize ⇒ Registry
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
#associations ⇒ Object (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
20 21 22 |
# File 'lib/object_json_mapper/associations/registry.rb', line 20 def find(name) associations.find { |a| a.name == name } end |