Hi ...
I've just downloaded the 'One-Click-windows installer' of Ruby (ver. 1.6.3)
.....
I've wanted to see if i could get this working, so i read a bit in the "Ruby
book" on RubyCentral.com ....
I've made a class, called Person,
## contents of file Person.rb ##
------8<------8<------8<------8<------8<------8<------8<------
class Person
def initalize(name, street, phone, age)
@name = name
@street = street
@phone = phone
@age = age
end
end
s = Person.new( "Soeren", "My Street", "12345678", "21" )
s.inspect
------8<------8<------8<------8<------8<------8<------8<------
When i choose "Run file" in RubyWin, i get this response in a 'console'
window
------8<------8<------8<------8<------8<------8<------8<------
E:\Udvikling\Ruby\Test_001\Person.rb:10:in `initialize': wrong # of
arguments(4 for 0)(ArgumentError)
from E:\Udvikling\Ruby\Test_001\Person.rb:10:in `initialize'
from E:\Udvikling\Ruby\Test_001\Person.rb:10:in `new'
from E:\Udvikling\Ruby\Test_001\Person.rb:10
from E:\Udvikling\Ruby\Test_001\Person.rb:12
------8<------8<------8<------8<------8<------8<------8<------
What am i doing wrong.... The Person-class should take 4 arguments ,,,
shouldn't it ??????
And where does the program excecution start ( I'm a Java and C++ programmer,
so i'm used to "void main" :-))))
/Søòen Munk Skrøäer
Odense, Denmark