Module: Kalimba::Reflection

Included in:
Resource
Defined in:
lib/kalimba/reflection.rb

Defined Under Namespace

Classes: AssociationReflection

Instance Method Summary collapse

Instance Method Details

#create_reflection(name, klass) ⇒ Object



12
13
14
# File 'lib/kalimba/reflection.rb', line 12

def create_reflection(name, klass)
  reflections[name] = AssociationReflection.new(name, {class_name: klass})
end

#reflect_on_association(association) ⇒ Object



16
17
18
# File 'lib/kalimba/reflection.rb', line 16

def reflect_on_association(association)
  reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil
end

#reflectionsObject



8
9
10
# File 'lib/kalimba/reflection.rb', line 8

def reflections
  @reflections ||= {}
end