diff options
Diffstat (limited to 'vendor/plugins/rspec/examples/pure/stack.rb')
-rw-r--r-- | vendor/plugins/rspec/examples/pure/stack.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/plugins/rspec/examples/pure/stack.rb b/vendor/plugins/rspec/examples/pure/stack.rb deleted file mode 100644 index 407173f7b..000000000 --- a/vendor/plugins/rspec/examples/pure/stack.rb +++ /dev/null @@ -1,36 +0,0 @@ -class StackUnderflowError < RuntimeError -end - -class StackOverflowError < RuntimeError -end - -class Stack - - def initialize - @items = [] - end - - def push object - raise StackOverflowError if @items.length == 10 - @items.push object - end - - def pop - raise StackUnderflowError if @items.empty? - @items.delete @items.last - end - - def peek - raise StackUnderflowError if @items.empty? - @items.last - end - - def empty? - @items.empty? - end - - def full? - @items.length == 10 - end - -end |