Module: Ooyala::ClassMethods
- Defined in:
- lib/ooyala.rb
Instance Method Summary collapse
- #api_codes(partner, secret) ⇒ Object
-
#edit(embed_code, options = {}) ⇒ Object
- TODO make an instance method Options: title
- String description
- String status
-
String - “live”, “paused” or “deleted” - Setting status to deleted deletes the video or channel.
-
#metadata(embed_code, action, options = {}) ⇒ Object
- TODO make an instance method Actions
- “add”, “query”, “delete_id”, “delete_query”
- Add opts
- director, actor, genre (multiple in an array) Search opts
- rows, op (OR, AND), and same as Add action but with asterisks for fuzzy searching Delete ID opts
- guid Delete Query opts
-
same as search (delete metadata).
- #query(options = {}) ⇒ Object
- #query_channel(channel_embed_code, options = {}) ⇒ Object
- #query_channel_list ⇒ Object
-
#thumbnails(embed_code, options = {}) ⇒ Object
- Options: rage
- String
- “0-4” resolution
- String
-
“320x240”.
Instance Method Details
#api_codes(partner, secret) ⇒ Object
24 25 26 27 |
# File 'lib/ooyala.rb', line 24 def api_codes(partner, secret) raise NoAPICodes if partner.blank? || secret.blank? [:api_codes] = {:partner => partner, :secret => secret} end |
#edit(embed_code, options = {}) ⇒ Object
TODO make an instance method Options:
- title
-
String
- description
-
String
- status
-
String - “live”, “paused” or “deleted” - Setting status to deleted deletes the video or channel.
- hostedAt
-
String - The URL for the main page the video or channel is embedded on.
59 60 61 62 63 64 65 66 67 |
# File 'lib/ooyala.rb', line 59 def edit(, ={}) raise NoEmmbedCode if .blank? = ['live', 'paused', 'deleted'] if ["status"] raise InvalidStatus unless .include?(["status"]) end opts = {"embedCode" => }.merge() self.get("/edit", :query => opts) end |
#metadata(embed_code, action, options = {}) ⇒ Object
TODO make an instance method
- Actions
- “add”, “query”, “delete_id”, “delete_query”
- Add opts
-
director, actor, genre (multiple in an array)
- Search opts
-
rows, op (OR, AND), and same as Add action but with asterisks for fuzzy searching
- Delete ID opts
-
guid
- Delete Query opts
-
same as search (delete metadata)
76 77 78 79 80 81 82 83 84 |
# File 'lib/ooyala.rb', line 76 def (, action, ={}) raise NoEmmbedCode if .blank? raise InvalidAction unless ["add", "query", "delete_id", "delete_query"].include?(action) if ["genre"].is_a?(Array) ["genre"] = ["genre"].join("\0") end opts = {"embedCode" => , "metaMode" => action}.merge() self.get("/metadata", :query => opts) end |
#query(options = {}) ⇒ Object
29 30 31 |
# File 'lib/ooyala.rb', line 29 def query(={}) self.get("/query", :query => ) end |
#query_channel(channel_embed_code, options = {}) ⇒ Object
37 38 39 40 |
# File 'lib/ooyala.rb', line 37 def query_channel(, = {}) opts = {'channelEmbedCode' => , 'mode' => 'list'}.merge() self.get("/channels", :query => opts) end |
#query_channel_list ⇒ Object
33 34 35 |
# File 'lib/ooyala.rb', line 33 def query_channel_list self.query('contentType' => 'Channel') end |
#thumbnails(embed_code, options = {}) ⇒ Object
Options:
- rage
- String
-
“0-4”
- resolution
- String
-
“320x240”
46 47 48 49 50 |
# File 'lib/ooyala.rb', line 46 def thumbnails(, ={}) raise NoEmmbedCode if .blank? opts = {"embedCode" => , "range" =>"0-25", "resolution" =>"600x400"}.merge() self.get("/thumbnails", :query => opts) end |