At the time, I did know object oriented, c++, computer science.
Therefore, I did not understand good elements of Ruby.
Now, I have grown up at that time!
I see document of ruby.
I understand that ruby is good programming language!!
Ruby is ideal object oriented programming.
Next codes are that I wrote yesterday.
#!/usr/bin/ruby
=begin
Hello !
Tomorrow, I will install ruby-el in My laptop-machine.
=end
# define my class
module My
class Data
attr_accessor :param, :index
# This method is original method
def output
p @param
p @index
end
# This method is constructor
def initialize( index, param)
@index = index
@param = param
end
end
end
# Following codes main thread!
begin
data = My::Data.new(10, "Hello Ruby!!")
p data.param
end
 


No comments:
Post a Comment