Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Ruby Inheritence
#Title of this code #ruby 1.9.3 puts "Hello, world!" class Person def initialize(name,age) @name=name @age=age end def to_s puts "My name is #{@name} and I am #{@age} years old " end end class Employee < Person def initialize(name,age,salary) super(@name,@age) @salary=salary end def to_s puts "My name is #{@name} and I am #{@age} years old and salary is #{@salary}" end end person=Employee.new("adsasd",21,131) puts person
run
|
edit
|
history
|
help
0
Division Function without / or * signs
Testing out multiple variable returns in a method
Calculator
Division Function without / or * signs
Hash and Symbols
Hex Color Reader (Ruby)
comments
variables 1
piramid2
faktorial