/**
 * Represents an Objective-C class "ivar", or instance variable.
 */

exports.wrap = wrap
exports.Ivar = Ivar

var core = require('./core')
  , proto = Ivar.prototype

function wrap (pointer) {
  if (pointer.isNull()) return null
  return new Ivar(pointer)
}

function Ivar (pointer) {
  this.pointer = pointer
}

proto.getName = function getName () {
  return core.ivar_getName(this.pointer)
}

proto.getOffset = function getOffset () {
  return core.ivar_getOffset(this.pointer)
}

proto.getTypeEncoding = function getTypeEncoding () {
  return core.ivar_getTypeEncoding(this.pointer)
}

proto.toString = function toString () {
  return '[Ivar: ' + [this.getName(), this.getTypeEncoding(), this.getOffset()].join(', ') +']'
}

proto.inspect = function inspect () {
  // red
  return '\033[31m' + this.toString() + '\033[39m'
}

@@ -1,8 +1,9 @@
+%0A
 /**%0A * R
@@ -68,16 +68,44 @@
 e.%0A */%0A%0A
+/**%0A * Module exports.%0A */%0A%0A
 exports.
@@ -137,16 +137,49 @@
 = Ivar%0A%0A
+/**%0A * Module dependencies.%0A */%0A%0A
 var core
@@ -227,16 +227,136 @@
 totype%0A%0A
+/**%0A * Wraps a Pointer that should be an Objective-C ivar (instance variable), and%0A * returns a new Ivar instance.%0A */%0A%0A
 function
@@ -439,16 +439,92 @@
 ter)%0A%7D%0A%0A
+/**%0A * The %60Ivar%60 Class. Wrapper around an Objective-C *ivar* pointer.%0A */%0A%0A
 function
@@ -565,24 +565,68 @@
  pointer%0A%7D%0A%0A
+/**%0A * Returns the name of the %60Ivar%60.%0A */%0A%0A
 proto.getNam
@@ -687,32 +687,78 @@
 his.pointer)%0A%7D%0A%0A
+/**%0A * Returns the offset of the %60Ivar%60.%0A */%0A%0A
 proto.getOffset 
@@ -822,27 +822,82 @@
 is.pointer)%0A
-
 %7D%0A%0A
+/**%0A * Returns the %22type encoding%22 of the %60Ivar%60.%0A */%0A%0A
 proto.getTyp

Add comments to ivar.js.