Skip to content
Browse files

Merge pull request #8 from Tonkpils/master

Improved README and structure instantiating change.
  • Loading branch information...
2 parents 4cfac67 + a67e034 commit 849bffae1048a3bdc69ae5a7d372ef30e8c0e887 @samdunne committed Dec 13, 2012
Showing with 28 additions and 13 deletions.
  1. +25 −1 README.md
  2. +0 −9 lib/rdata.rb
  3. +1 −1 lib/rdata/version.rb
  4. +1 −1 spec/queue_spec.rb
  5. +1 −1 spec/stack_spec.rb
View
26 README.md
@@ -10,6 +10,7 @@ Project goal is to provide a very clear and concise library of datastructures an
## Data Structures
* [Stacks](#stacks)
+* [Queue](#queues)
## Installation
```ruby
@@ -32,7 +33,7 @@ require 'rdata'
### Initialization
```ruby
-@stack = RData.Stack
+@stack = RData::Stack.new
```
### Operations
@@ -47,3 +48,26 @@ require 'rdata'
### More on Stacks
[Stacks - Wiki Link](https://github.com/samdunne/rdata/wiki/Stacks)
+##<a name='queues'>Queues</a>
+
+### Initialization
+
+```ruby
+@queue = RData::Queue.new
+```
+
+### Operations
+
+```ruby
+@queue.enqueue(9) # => Returns '9'
+@queue.dequeue # => Returns 'head'
+@queue.peek # => Returns 'head' without removing it
+@queue.is_empty? # => Returns true/false
+```
+
+### More on Queues
+Coming Soon...
+
+
+
+
View
9 lib/rdata.rb
@@ -1,12 +1,3 @@
require 'rdata/version'
require "rdata/stack.rb"
require "rdata/queue.rb"
-
-module RData
- def self.Stack
- Stack.new
- end
- def self.Queue
- Queue.new
- end
-end
View
2 lib/rdata/version.rb
@@ -1,3 +1,3 @@
module RData
- VERSION = "0.2.1"
+ VERSION = "0.3.0"
end
View
2 spec/queue_spec.rb
@@ -2,7 +2,7 @@
describe RData::Queue do
- let(:queue) { RData.Queue }
+ let(:queue) { RData::Queue.new }
context "An empty queue" do
View
2 spec/stack_spec.rb
@@ -2,7 +2,7 @@
describe RData::Stack do
- let(:stack) { RData.Stack }
+ let(:stack) { RData::Stack.new }
context "An empty stack" do

0 comments on commit 849bffa

Please sign in to comment.
Something went wrong with that request. Please try again.