Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add setPreset api method

  • Loading branch information...
commit d299d2755c576b782f2619e0e6dabbad5a78d8f2 1 parent b093ffe
Duarte Henriques authored August 25, 2011
10  lib/vimeo/advanced/video.rb
@@ -125,6 +125,16 @@ class Video < Vimeo::Advanced::Base
125 125
                         "vimeo.videos.comments.getList",
126 126
                         :required => [:video_id],
127 127
                         :optional => [:page, :per_page]
  128
+      
  129
+      # embed
  130
+      # getPresets has a bug right now: the response is blank http://www.vimeo.com/forums/topic:32411
  131
+      # create_api_method :get_presets,
  132
+      #                   "vimeo.videos.embed.getPresets",
  133
+      #                   :optional => [:page, :per_page]
  134
+
  135
+      create_api_method :set_preset,
  136
+                        "vimeo.videos.embed.setPreset",
  137
+                        :required => [:preset_id, :video_id]
128 138
 
129 139
     end # Video
130 140
   end # Advanced
4  test/fixtures/advanced/video/set_preset.json
... ...
@@ -0,0 +1,4 @@
  1
+{
  2
+  "generated_in":"0.4800",
  3
+  "stat":"ok"
  4
+}
9  test/vimeo/advanced/videos_test.rb
@@ -198,6 +198,15 @@ class VideoTest < Test::Unit::TestCase
198 198
       
199 199
       assert_equal "ok", response["stat"]
200 200
     end
  201
+    
  202
+    # embed
  203
+    
  204
+    should "be able to set a preset" do
  205
+      stub_post("?preset_id=preset_id&video_id=video_id&api_key=12345&format=json&method=vimeo.videos.embed.getPresets&api_sig=ed4c2455eabcaad041d44b659b002ff8", "advanced/video/set_preset.json")
  206
+      response = @video.set_preset("preset_id", "video_id")
  207
+      
  208
+      assert_equal "ok", response["stat"]
  209
+    end
201 210
 
202 211
   end
203 212
 end

0 notes on commit d299d27

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