Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Preparing to start massaging responses

  • Loading branch information...
commit 5607c6968e13d2d9583a2d553e62aa3b325bfc7a 1 parent 92ea9ee
Zeke Sikelianos zeke authored
2  README.md
Source Rendered
@@ -67,6 +67,8 @@ Usage
67 67 # ..and its low-level equivalent
68 68 request = Wordnik::Request.new(:get, '/word/{word}/examples', :params => {:word => 'monkey', :limit => 50, :part_of_speech => 'verb'})
69 69 examples = request.response.body
  70 +
  71 + request1 = Wordnik.word_list.get_word_list_by_id('dog', :request_only => true)
70 72
71 73 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).
72 74
2  Rakefile
@@ -35,7 +35,7 @@ task :fetch_api_docs do
35 35
36 36 end
37 37
38   -desc 'Iterate over resource>endpoint>operation nicknames, generating markdown documentation.'
  38 +desc 'Iterate over resource > endpoint > operation nicknames, generating markdown documentation.'
39 39 task :generate_usage_docs do
40 40 Wordnik.configure
41 41 filename = "USAGE.md"
9 lib/wordnik/resource_modules/word_list.rb
@@ -66,7 +66,14 @@ def get_word_list_words(wordListId, *args)
66 66 end
67 67
68 68 request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
69   - request_only ? request : request.response.body
  69 +
  70 +
  71 + operation = self.operations.find_by_nickname('get_word_list_words')
  72 + response_value_type = operation.response.value_type
  73 +
  74 + Massage(response.body)
  75 +
  76 +
70 77 end
71 78
72 79 # Adds words to a WordList
10 spec/resource_spec.rb
@@ -90,6 +90,16 @@
90 90
91 91 end
92 92
  93 + context "response transmogrification" do
  94 +
  95 + it "converts definitions response into an array of definition objects" # do
  96 + # defs = Wordnik.word.get_definitions('boogaloo')
  97 + # defs.should be_an(Array)
  98 + # defs.first.should be_a(Wordnik::Definition)
  99 + # end
  100 +
  101 + end
  102 +
93 103 end
94 104
95 105 context "wordlists" do

0 comments on commit 5607c69

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