README.md in linodians-0.0.4 vs README.md in linodians-0.0.5
- old
+ new
@@ -68,19 +68,26 @@
employees = Linodians.new
titles = employees.map(&:title).each_with_object(Hash.new(0)) { |i, o| o[i] += 1 }
titles.sort_by(&:last).each { |title, count| puts "#{count} -- #{title}" }
```
+A helper ".lookup" method is provided on top of Array's usual tools, and it is a shortcut for `find { |x| x.username == username }`. As such, you can use it to look somebody up by their username:
+
+```
+employees = Linodians.new
+my_friend = employees.lookup('caker')
+```
+
#### Loading in existing data
If you already have a hash of data, like one created with `Linodians.new.to_json`, you can import it back in when making a new Linodians object:
```
require 'linodians'
require 'json'
data = File.open('data.json') { |fh| JSON.parse fh }
-linodians = Linodians.new(data)
+employees = Linodians.new(data)
```
## Installation
gem install linodians