Skip to content

Instantly share code, notes, and snippets.

@jdewind
Created August 16, 2013 20:03
Show Gist options
  • Save jdewind/6253088 to your computer and use it in GitHub Desktop.
Save jdewind/6253088 to your computer and use it in GitHub Desktop.
typedef struct JSObjectionPropertyInfo {
__unsafe_unretained id value;
JSObjectionType type;
} JSObjectionPropertyInfo;
@protocol JSObjectionPropertyReflector <NSObject>
- (JSObjectionPropertyInfo)propertyForClass:(Class)theClass andProperty:(NSString *)propertyName;
@end
class RubyPropertyReflector < JSObjectionPropertyReflector
def propertyForClass(klass, andProperty: property)
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
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment