This repository has been archived by the owner on Sep 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Implemented schemas.video.category #8
Merged
avokhmin
merged 4 commits into
Shuttlerock-Archive:master
from
BenjaminSchaaf:api_schemas-video-category
Dec 10, 2015
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module Youku | ||
module V2 | ||
class Schemas < Base | ||
BASE_URI = "#{BASE_URI}/schemas" | ||
|
||
# Public: Get video API. | ||
# | ||
# Returns the instance of Youku::V2::Schemas::Video. | ||
def video | ||
Video.new(client) | ||
end | ||
|
||
class Video < Base | ||
BASE_URI = "#{BASE_URI}/video" | ||
|
||
# Public: Get video categories. | ||
# | ||
# See: http://open.youku.com/docs?id=90 | ||
# | ||
# Returns the instance of Youku::V2::Request. | ||
def category() | ||
Youku::V2::Request.new "#{BASE_URI}/category.json" | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require 'spec_helper' | ||
|
||
describe Youku::V2::Schemas do | ||
|
||
let(:client) { Youku::Client.new(client_id: 'client-id') } | ||
|
||
describe '#video' do | ||
subject { client.schemas.video } | ||
|
||
it { expect(subject).to be_a Youku::V2::Schemas::Video } | ||
it { expect(subject.client).to eq client } | ||
end | ||
|
||
describe '::Video' do | ||
describe '#category' do | ||
let(:url) { 'https://openapi.youku.com/v2/schemas/video/category.json' } | ||
let(:query) { {} } | ||
|
||
before do | ||
stub_request(:get, url).with(query: query).to_return(status: 200) | ||
end | ||
|
||
subject { client.schemas.video.category } | ||
|
||
it_should_behave_like 'a base Youku API V2 requests' | ||
end | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change to
http://cloud.youku.com/docs?id=90