class ModelMaker::Property

Attributes

name[R]
project[RW]

Public Class Methods

new(name) click to toggle source
# File src/lib/modelmaker.rb, line 196
def initialize(name)
    @name = name
end

Public Instance Methods

assignation_line() click to toggle source
# File src/lib/modelmaker.rb, line 238
def assignation_line
    "#{internal_name} = #{assignation_value}"
end
assignation_value() click to toggle source
# File src/lib/modelmaker.rb, line 234
def assignation_value
    exposed_name
end
comment_line() click to toggle source
# File src/lib/modelmaker.rb, line 242
def comment_line
    nil
end
exposed_name() click to toggle source
# File src/lib/modelmaker.rb, line 212
def exposed_name
    @name
end
exposed_type() click to toggle source
# File src/lib/modelmaker.rb, line 204
def exposed_type
    type
end
init_line() click to toggle source
# File src/lib/modelmaker.rb, line 224
def init_line
    nil
end
internal_name() click to toggle source
# File src/lib/modelmaker.rb, line 208
def internal_name
    "_#{@name}"
end
internal_type() click to toggle source
# File src/lib/modelmaker.rb, line 200
def internal_type
    type
end
make_classname(type) click to toggle source
# File src/lib/modelmaker.rb, line 246
def make_classname(type)
    # If we're linked to a project and class has no prefix
    if project and not type =~ /^[A-Z]{3}/
        "#{project.class_prefix}#{type} *"
    else
        "#{type} *"
    end
end
needs_init?() click to toggle source
# File src/lib/modelmaker.rb, line 220
def needs_init?
    false
end
setter_signature() click to toggle source
# File src/lib/modelmaker.rb, line 228
def setter_signature
    name = exposed_name.to_s
    name[0] = name[0].upcase
    "- (void)set#{name}:(#{exposed_type})#{exposed_name}"
end
type() click to toggle source
# File src/lib/modelmaker.rb, line 216
def type
    raise "Implement me, or override internal_type and external_type"
end