wordnik 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/wordnik.rb +5 -4
  3. data/wordnik.gemspec +1 -1
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -3,6 +3,9 @@ require 'httparty'
3
3
  class Wordnik
4
4
  include HTTParty
5
5
 
6
+ PARTS_OF_SPEECH = [:noun, :verb, :adjective, :adverb, :idiom, :article, :abbreviation,
7
+ :preposition, :prefix, :interjection, :suffix, :"verb-transitive", :"verb-intransitive"]
8
+
6
9
  attr_reader :api_key
7
10
 
8
11
  base_uri 'http://api.wordnik.com/api'
@@ -79,11 +82,9 @@ class Wordnik
79
82
  options[:hasDictionaryDef] = !!opts[:hasDictionaryDef] if opts.key?(:hasDictionaryDef)
80
83
 
81
84
  if opts.key?(:partOfSpeech)
82
- options[:partOfSpeech] = opts[:partOfSpeech].reject do |pos|
83
- ![:noun, :verb, :adjective, :adverb, :idiom, :article, :abbreviation, :preposition, :prefix, :interjection, :suffix].include?(pos.to_sym)
84
- end
85
+ options[:partOfSpeech] = opts[:partOfSpeech].to_a.reject { |pos| !PARTS_OF_SPEECH.include?(pos.to_sym) }.join(',')
85
86
  end
86
87
 
87
- options
88
+ { :query => options }
88
89
  end
89
90
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wordnik}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jason Adams"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jason Adams