Class: EagerEye::AssociationParser

Inherits:
Object
  • Object
show all
Defined in:
lib/eager_eye/association_parser.rb

Constant Summary collapse

ASSOCIATION_METHODS =
%i[has_many has_one belongs_to has_and_belongs_to_many].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAssociationParser

Returns a new instance of AssociationParser.



9
10
11
# File 'lib/eager_eye/association_parser.rb', line 9

def initialize
  @preloaded_associations = {}
end

Instance Attribute Details

#preloaded_associationsObject (readonly)

Returns the value of attribute preloaded_associations.



7
8
9
# File 'lib/eager_eye/association_parser.rb', line 7

def preloaded_associations
  @preloaded_associations
end

Instance Method Details

#parse_model(ast, model_name) ⇒ Object



13
14
15
16
17
# File 'lib/eager_eye/association_parser.rb', line 13

def parse_model(ast, model_name)
  return unless ast

  traverse(ast, model_name)
end