Module: Morpheus::Mixins::Reflections::ClassMethods
- Defined in:
- lib/morpheus/mixins/reflections.rb
Instance Method Summary collapse
- #create_reflection(macro, name, options) ⇒ Object
- #reflect_on_association(association) ⇒ Object
- #reflections ⇒ Object
Instance Method Details
#create_reflection(macro, name, options) ⇒ Object
11 12 13 14 15 |
# File 'lib/morpheus/mixins/reflections.rb', line 11 def create_reflection(macro, name, ) Reflection.new(macro, name, ).tap do |reflection| reflections.merge!(name => reflection) end end |
#reflect_on_association(association) ⇒ Object
21 22 23 |
# File 'lib/morpheus/mixins/reflections.rb', line 21 def reflect_on_association(association) reflections[association.to_sym].is_a?(Reflection) ? reflections[association.to_sym] : nil end |
#reflections ⇒ Object
17 18 19 |
# File 'lib/morpheus/mixins/reflections.rb', line 17 def reflections @reflections ||= {} end |