Class: RubyPropertyReflector

Inherits:
JSObjectionRuntimePropertyReflector
  • Object
show all
Defined in:
lib/motion-objection/ruby_property_reflector.rb

Instance Method Summary collapse

Instance Method Details

#propertyForClass(klass, andProperty: property) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/motion-objection/ruby_property_reflector.rb', line 2

def propertyForClass(klass, andProperty: property)
  if klass.respondsToSelector :objectionTypeMappings
    dependency_type = klass.send(:objectionTypeMappings)[property]
    unless dependency_type.is_a? Class
      dependency_type = dependency_type.objection_constantize
    end
    property_info = JSObjectionPropertyInfo.new
    property_info.value = dependency_type
    property_info.type = JSObjectionTypeClass
    property_info
  else
    super
  end
end