Last active
December 16, 2015 15:29
-
-
Save BrayanZ/5456153 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Employee | |
def initialize name, salary | |
@name = name | |
@salary = salary | |
end | |
def salary | |
return salary | |
end | |
def increase_salary_by increase | |
@salary += increase | |
end | |
def decrease_salary_by decrease | |
@salary -= decrease | |
end | |
end | |
employee = Employee.new("Homer", 500) | |
employee.increase_salary_by 500 | |
print employee.salary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment