D
Daniel Dale
I was told about Ruby several weeks ago and started my journey lol. I've
read several tutorials but reading the tutorials I still couldn't grasp
most of it and I thought finding a project I wanted to work on and
just diving in might be the best bet.
I want to create a program that I can enter my game collection into.
Ideally I want it to have a simple gui so others can use it and input
their games as well.
Here's the basic code I have I keep getting an error stating
uninitialized constant Game (NameError)
code:
class Games
def
initialize(title,platform,genre,rating,published_by,developed_by,year,condition)
@title=title
@platform=platform
@genre=genre
@rating=rating
@published_by=published_by
@developed_by=developed_by
@year=year
@condition=condition
end
end
class Games
def to_s
"Games:
#{@title}--#{@platform}--#{@genre}--#{@rating}--#{@published_by}--#(@developed_by)--#(@year)--#(@condition)"
end
end
game1=Game.new("FireProReturns","Playstation_2","Sports","Teen","Agetec_Inc.","Very_Good")
game1.to_s
Any help tips and etc on how to fix my problem and proceed will be
greatly appreciated.
read several tutorials but reading the tutorials I still couldn't grasp
most of it and I thought finding a project I wanted to work on and
just diving in might be the best bet.
I want to create a program that I can enter my game collection into.
Ideally I want it to have a simple gui so others can use it and input
their games as well.
Here's the basic code I have I keep getting an error stating
uninitialized constant Game (NameError)
code:
class Games
def
initialize(title,platform,genre,rating,published_by,developed_by,year,condition)
@title=title
@platform=platform
@genre=genre
@rating=rating
@published_by=published_by
@developed_by=developed_by
@year=year
@condition=condition
end
end
class Games
def to_s
"Games:
#{@title}--#{@platform}--#{@genre}--#{@rating}--#{@published_by}--#(@developed_by)--#(@year)--#(@condition)"
end
end
game1=Game.new("FireProReturns","Playstation_2","Sports","Teen","Agetec_Inc.","Very_Good")
game1.to_s
Any help tips and etc on how to fix my problem and proceed will be
greatly appreciated.