[Proto-Scripty] Re: I need to get what class is creating in initialize method

2012-01-10 Thread Victor
this.constructor

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/prototype-scriptaculous/-/PyRvfGebg24J.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: I need to get what class is creating in initialize method

2012-01-10 Thread Victor
As part of scriptaculous' unit test:

testAnonSubclass: function() {
  var C1 = Class.create({
method1: function() {
  return C1;
}
  }), C2 = Class.create(C1, {
method2: function() {
  return C2;
},
createSubclass: function() {
  return Class.create(this.constructor, {
method3: function() {
  return subclass;
}
  });
}
  });
  var o2 = new C2(), C3 = o2.createSubclass(), o3 = new C3();
  this.assertInstanceOf(C1, o2, o2 instanceOf C1);
  this.assertInstanceOf(C2, o2, o2 instanceOf C2);
  this.assertInstanceOf(C1, o3, o3 instanceOf C1);
  this.assertInstanceOf(C2, o3, o3 instanceOf C2);
  this.assert(Object.isFunction(o3.method1), o3.method1);
  this.assert(Object.isFunction(o3.method2), o3.method2);
  this.assert(Object.isFunction(o3.method3), o3.method3);
}

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/prototype-scriptaculous/-/xhtjEXT7B7oJ.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Re: I need to get what class is creating in initialize method

2012-01-05 Thread buda
I also need in my class method to have an ability to create ansector
class from the current
How I could achieve the reference to the class within it mwthod?

-- 
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.