Okay, I'm doing the Peepcode on _javascript_ and I have the latest Firebug installed and I'm displaying http://www.prototypejs.org/, so the latest prototype library is active (it works with other examples).
Following the Peepcode, I enable the Console and the multi-line entry box on the right, enter this code
var Butter = Class.create();
Butter.prototype = {
inititalize: function(brand) {
this.brand = brand;
this.melted = false;
},
melt: function() {
this.melted = true;
}
};
and hit Run; it says
>>> var Butter = Class.create(); Butter.prototype = {... melt: function() { this.melted = true; } };
Object
which is fine. Then I Clear and close the multi-line entry box and put this into the single-line entry box at the bottom in slavish imitation of Geoffrey Grosenbach:
var parkay = new Butter('Parkay')
hit Enter and it says
>>> var parkay = new Butter('Parkay')
TypeError: this.initialize is undefined
Adding a semicolon produces the same result:
>>> var parkay = new Butter('Parkay');
Anybody got a hint for me? And if you're responding before Tuesday morning, why aren't you out at play somewhere?
Thanks,
Scott
--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---
- [SDRuby] We're proud to announce MerbCamp! Patrick Crowley
- [SDRuby] Re: We're proud to announce MerbCamp! Matt Aimonetti
- [SDRuby] Re: We're proud to announce MerbCamp! Edward O'Connor
- [SDRuby] Re: We're proud to announce MerbCamp... Matt Aimonetti
- [SDRuby] Re: We're proud to announce Merb... Edward O'Connor
- [SDRuby] Re: We're proud to announce... Matt Aimonetti
- [SDRuby] Javascript question Scott Olmsted
- [SDRuby] Re: Javascript ques... Dan Simpson
- [SDRuby] Re: Javascript ques... Scott Olmsted
- [SDRuby] Re: Javascript ques... David A McClain
- [SDRuby] Re: Javascript ques... Scott Olmsted
- [SDRuby] Re: Javascript ques... David A McClain
- [SDRuby] Re: Javascript ques... Dan Simpson
- [SDRuby] Re: Javascript ques... David A McClain
- [SDRuby] Re: Javascript ques... Dan Simpson
- [SDRuby] Re: We're proud to announce MerbCamp... Ryan Felton
- [SDRuby] Re: We're proud to announce Merb... John Bresnik
