Created
February 4, 2016 21:50
-
-
Save worace/bf0267fee2e0115ce1d8 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 FishTank | |
| def initialize | |
| # great place to do any initial | |
| # setup or configuration | |
| @fish = [] | |
| @water_volume = 0 | |
| @salinity = nil | |
| end | |
| def fill_tank(volume, water_type) | |
| @water_volume = volume + @water_volume | |
| @salinity = water_type | |
| end | |
| def salinity | |
| @salinity | |
| end | |
| def add_fish(fish) | |
| @fish << fish | |
| end | |
| def count_fish | |
| @fish.count | |
| end | |
| end | |
| tank = FishTank.new | |
| puts "made a tank: #{tank}" | |
| puts tank.count_fish |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment