README.md in haversack-0.2.0 vs README.md in haversack-0.3.0
- old
+ new
@@ -1,11 +1,34 @@
# Haversack
-Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/haversack`. To experiment with that code, run `bin/console` for an interactive prompt.
+Haversack is an enumerable abstraction of a [Knapsack](https://en.wikipedia.org/wiki/Knapsack_problem).
-TODO: Delete this and the text above, and describe your gem
+## Usage
+#### Basic Usage:
+```ruby
+require 'haversack'
+
+haversack = Sack.new(capacity: 10, weight: 10)
+items = Array.new(10) { Haversack::Item.new(weight: 1, size: 1) }
+
+haversack.contents = items
+```
+Only objects of the `Haversack::Item` class may be added to a haversack's contents.
+
+#### Haversack provides constraints upon what items may be set as the knapsack contents:
+```ruby
+too_large = Array.new(haversack.capacity + 1) { Haversack::Item.new }
+haversack.contents = too_large # => Haversack::KnapsackCapacityExceededError
+```
+
+#### Or you may add one item at a time
+```ruby
+item = Haversack::Item.new
+haversack.push item if haversack.fits_item? item
+```
+
## Installation
Add this line to your application's Gemfile:
```ruby
@@ -18,12 +41,9 @@
Or install it yourself as:
$ gem install haversack
-## Usage
-
-TODO: Write usage instructions here
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.