class RestKat::ObjCProperty

Attributes

klass[RW]
name[RW]

Public Class Methods

new(klass, name) click to toggle source
# File lib/rest_kat.rb, line 85
def initialize(klass, name)
  raise Exception.new(":klass parameter cannot be nil") unless klass
  raise Exception.new(":name parameter cannot be nil") unless name
  self.klass = klass
  self.name = name
end

Public Instance Methods

ns_attribute_type() click to toggle source
# File lib/rest_kat.rb, line 92
def ns_attribute_type
    #         typedef enum {
    #             NSUndefinedAttributeType = 0,
    #             NSInteger16AttributeType = 100,
    #             NSInteger32AttributeType = 200,
    #             NSInteger64AttributeType = 300,
    #             NSDecimalAttributeType = 400,
    #             NSDoubleAttributeType = 500,
    #             NSFloatAttributeType = 600,
    #             NSStringAttributeType = 700,
    #             NSBooleanAttributeType = 800,
    #             NSDateAttributeType = 900,
    #             NSBinaryDataAttributeType = 1000,
    #             NSTransformableAttributeType = 1800,
    #             NSObjectIDAttributeType = 2000
    #             } NSAttributeType;
    case self.klass.objc_class
    when "NSNumber"
        case self.klass.json_type
        when "int"
            "NSInteger32AttributeType"
        when "float"
            "NSFloatAttributeType"
        when "bool"
            "NSBooleanAttributeType"
        end
    when "NSDate"
        "NSDateAttributeType"
    when "NSString"
        "NSStringAttributeType"
    else
        raise Exception.new("Unknown type #{self.klass.objc_class} for NSAttributeType to be handled for property #{self.name}" )
    end
    
end