Skip to content
Browse files

Preparing to start massaging responses

  • Loading branch information...
1 parent 92ea9ee commit 5607c6968e13d2d9583a2d553e62aa3b325bfc7a @zeke zeke committed May 2, 2011
Showing with 21 additions and 2 deletions.
  1. +2 −0 README.md
  2. +1 −1 Rakefile
  3. +8 −1 lib/wordnik/resource_modules/word_list.rb
  4. +10 −0 spec/resource_spec.rb
View
2 README.md
@@ -67,6 +67,8 @@ Usage
# ..and its low-level equivalent
request = Wordnik::Request.new(:get, '/word/{word}/examples', :params => {:word => 'monkey', :limit => 50, :part_of_speech => 'verb'})
examples = request.response.body
+
+ request1 = Wordnik.word_list.get_word_list_by_id('dog', :request_only => true)
For a full list of methods, checkout [USAGE.md](https://github.com/wordnik/wordnik-ruby/blob/master/USAGE.md). The wordnik gem automatically generates its convenience methods by parsing the [Wordnik API documentation](http://developer.wordnik.com/docs).
View
2 Rakefile
@@ -35,7 +35,7 @@ task :fetch_api_docs do
end
-desc 'Iterate over resource>endpoint>operation nicknames, generating markdown documentation.'
+desc 'Iterate over resource > endpoint > operation nicknames, generating markdown documentation.'
task :generate_usage_docs do
Wordnik.configure
filename = "USAGE.md"
View
9 lib/wordnik/resource_modules/word_list.rb
@@ -66,7 +66,14 @@ def get_word_list_words(wordListId, *args)
end
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
- request_only ? request : request.response.body
+
+
+ operation = self.operations.find_by_nickname('get_word_list_words')
+ response_value_type = operation.response.value_type
+
+ Massage(response.body)
+
+
end
# Adds words to a WordList
View
10 spec/resource_spec.rb
@@ -90,6 +90,16 @@
end
+ context "response transmogrification" do
+
+ it "converts definitions response into an array of definition objects" # do
+ # defs = Wordnik.word.get_definitions('boogaloo')
+ # defs.should be_an(Array)
+ # defs.first.should be_a(Wordnik::Definition)
+ # end
+
+ end
+
end
context "wordlists" do

0 comments on commit 5607c69

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