I have created folowing simple class:
class Test
def initialize(a, b)
@a = a
@b = b
end
def test
puts @a
end
end
IS there a way to replace @a
with self
? Everytime I tried to do this I received an error:
undefined method `a'
The reason I am doing this is because I would like to create a new object with two parameters, and later operate on these parameters like:
d = MyObject('title', 'Author')
d.showAuthor