file.write """
+{{{attribute.doc}}}
{{{c}}} fun {{{nit_attr_name}}}: {{{nit_attr_type}}} in "ObjC" `{
{{{c}}} return [self {{{attribute.name}}}];
{{{c}}} `}
file.write """
+{{{attribute.doc}}}
{{{c}}} fun {{{nit_attr_name}}}=(value: {{{nit_attr_type}}}) in "ObjC" `{
{{{c}}} return self.{{{attribute.name}}} = value;
{{{c}}} `}
file.write """
+{{{method.doc}}}
{{{c}}}{{{fun_keyword}}} {{{name}}}{{{params_with_par}}}{{{ret}}} in "ObjC" `{
"""
end
private fun comment_str: String do if is_commented then
return "#"
else return ""
+
+ # Full documentation to be generated for the Nit code
+ private fun doc: String is abstract
end
redef class ObjcMethod
private fun indent: String do return if is_class_property then "" else "\t"
redef fun comment_str do return indent + super
+
+ redef fun doc
+ do
+ var recv = if is_class_property then objc_class.name else "self"
+ return "{indent}# Wraps: `[{recv} {params.join(" ")}]`"
+ end
+end
+
+redef class ObjcAttribute
+ redef fun doc do return "\t# Wraps: `{objc_class.name}.{name}`"
end
# Is this a parameter with only a `name`?
var is_single = false is writable
+
+ redef fun to_s
+ do
+ if is_single then return name
+ return "{name}:({return_type}){variable_name}"
+ end
end