Created
March 20, 2014 00:20
-
-
Save scolon7251/9654680 to your computer and use it in GitHub Desktop.
syntax error
This file contains 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
require_relative "stacklike" | |
class Stack | |
include Stacklike | |
end |
This file contains 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
module Stacklike | |
def stack | |
@stack || = [] | |
end | |
def add_to_stack(obj) | |
stack.push(obj) | |
end | |
def take_from_stack | |
stack.pop | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment