Sha256: 7ffc016bf995191f1ceea56d152d81410e6c1b52ab1c465caed1bdf0d2f66712
Contents?: true
Size: 1014 Bytes
Versions: 1
Compression:
Stored size: 1014 Bytes
Contents
# Urban Dictionary # `urban_dictionary` is a Ruby gem to access word definitions and examples from [Urban Dictionary](http://www.urbandictionary.com/). It also provides a command-line tool for getting definitions. ## Installation ## Run `gem install urban_dictionary`. ## Usage ## Get words using `UrbanDictionary.define` or `UrbanDictionary.random_word`. These methods return an instance of UrbanDictionary::Word, which has a list of entries. Each entry has a definition and an example. require 'urban_dictionary' word = UrbanDictionary.define("QED") word.entries.size # => 7 word.entries.each do |entry| puts entry.definition puts entry.example end ## Command Line ## The urban_dictionary gem includes a command-line interface: > urban_dictionary super salad super salad ----------- 1. A mythical dish of the best salad ever compiled ... ... You can use the `--random` flag to get the definition of random word: > urban_dictionary --random
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
urban_dictionary-0.0.1 | README.md |