Last active
December 25, 2015 18:49
-
-
Save rosiehoyem/7023062 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 Plastic | |
def initialize | |
@plastic_bin = [] | |
@plastic_types = ["num_1", "num_2", "num_3", "num_4", "num_5", "num_6", "num_7"] | |
end | |
def recycle_plastic(trash) | |
self.plastic_bin << trash if plastic_types.include?(trash) | |
end | |
end | |
class Glass | |
def initialize | |
@glass_bin = [] | |
@glass_types = ["clear", "color"] | |
def recycle_glass(trash) | |
self.glass_bin << trash if glass_types.include?(trash) | |
end | |
end | |
class Paper | |
def initialize | |
@paper_bin = [] | |
@paper_types = ["paper", "cardboard"] | |
end | |
def recycle_paper(trash) | |
self.paper_bin << trash if paper_types.include?(trash) | |
end | |
end | |
class Metal | |
def initialize | |
@metal_bin = [] | |
@metal_types = ["aluminum", "tin", "copper"] | |
end | |
def recycle_metal(trash) | |
self.metal_bin << trash if metal_types.include?(trash) | |
end | |
end | |
class Landfill | |
def initialize | |
@landfill_bin = [] | |
end | |
def landfill(trash) | |
Metal.metal_types.include?(trash) | |
Paper.paper_types.include?(trash) | |
Glass.glass_types.include?(trash) | |
Plastic.plastic_types.include?(trash) | |
self.landfill_bin << trash | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment