Skip to content

Instantly share code, notes, and snippets.

@BrayanZ
Last active December 16, 2015 15:29
Show Gist options
  • Save BrayanZ/5456153 to your computer and use it in GitHub Desktop.
Save BrayanZ/5456153 to your computer and use it in GitHub Desktop.
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