Skip to content

Instantly share code, notes, and snippets.

@seanreed1111
Last active December 29, 2015 13:39
Show Gist options
  • Save seanreed1111/7678739 to your computer and use it in GitHub Desktop.
Save seanreed1111/7678739 to your computer and use it in GitHub Desktop.
class SimpleStack
class SimpleStack
def initialize
@stack = Array.new
end
#removes the first item from the stack and returns the item popped
def pop
@stack.pop
end
#pushes item to stack and returns @stack
def push(item)
@stack.push(item)
end
def size
@stack.length
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment