Skip to content

Instantly share code, notes, and snippets.

Created December 14, 2012 04:23
Show Gist options
  • Save anonymous/4282683 to your computer and use it in GitHub Desktop.
Save anonymous/4282683 to your computer and use it in GitHub Desktop.
ruby Class_Case_Study_2.rb
Class_Case_Study_2.rb:24:in `initialize': wrong number of arguments(3 for 0) (ArgumentError)
from Class_Case_Study_2.rb:24:in `new'
from Class_Case_Study_2.rb:24:in `<main>'
#!/usr/bin/ruby
class TestRuby
##GLOBAL VARIABLES (Use @@)
def initialized(varA, varB, varC)
@data1=varA
@data2=varB
@data3=varC
end
def displayData()
puts "Variable A is: #@varA"
puts "Variable B is: #@varB"
puts "Variable C is: #@varC"
end
end
## CreateOBJECTS
methOne=TestRuby.new("56", "toto", "fart is the math")
## Call Objects
methOne.displayData()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment