Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oguzcanhuner/d9d8ba1e0f5d1e6ca5256f6e537643f8 to your computer and use it in GitHub Desktop.
Save oguzcanhuner/d9d8ba1e0f5d1e6ca5256f6e537643f8 to your computer and use it in GitHub Desktop.
class Plane
def initialize
@state = "stationary"
end
def flying?
@state == "flying"
end
def stationary?
@state == "stationary"
end
def takeoff
return false if flying
@state == "flying"
end
def land
return false if stationary?
@state == "stationary"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment