class Xcodeproj::Project::Object::Association::Reflection
def association_for(owner, &block)
def association_for(owner, &block) case type when :has_many then Association::HasMany when :has_one then Association::HasOne end.new(owner, self, &block) end
def attribute_getter
def attribute_getter case type when :has_many uuid_method_name.pluralize when :has_one uuid_method_name end.to_sym end
def attribute_name
def attribute_name (@options[:uuid] || @options[:uuids] || @name).to_sym end
def attribute_setter
def attribute_setter "#{attribute_getter}=".to_sym end
def getter
def getter @name.to_sym end
def initialize(type, name, options)
def initialize(type, name, options) @type, @name, @options = type, name.to_s, options end
def inverse
def inverse klass.reflection(@options[:inverse_of]) end
def inverse?
def inverse? !!@options[:inverse_of] end
def klass
def klass @options[:class] ||= begin name = "PBX#{@name.classify}" name = "XC#{@name.classify}" unless Xcodeproj::Project::Object.const_defined?(name) Xcodeproj::Project::Object.const_get(name) end end
def setter
def setter "#{@name}=".to_sym end
def uuid_method_name
def uuid_method_name (@options[:uuids_as] || @options[:uuid] || @options[:uuids] || "#{@name.singularize}_reference").to_s.singularize end