Class: Yourub::Client
- Inherits:
-
Google::APIClient
- Object
- Google::APIClient
- Yourub::Client
- Includes:
- MetaSearch
- Defined in:
- lib/yourub/client.rb
Instance Attribute Summary collapse
-
#videos ⇒ Object
readonly
Returns the value of attribute videos.
Instance Method Summary collapse
- #config ⇒ Object
- #countries ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
The Yourub::Client is a subclass of the Google::APIClient.
-
#youtube_api ⇒ Object
it returns the youtube service object.
Methods included from MetaSearch
Methods included from REST::Videos
Methods included from REST::Categories
Methods included from REST::Search
Constructor Details
#initialize(options = {}) ⇒ Client
The Yourub::Client is a subclass of the Google::APIClient.
In order to initialize the client, you have either to provide a configuration file ‘config/yourub.yml’ in your main application folder or to pass an hash in the initialization. If you don’t provide all the values, default values will be used.The only mandatory value is the developer_key
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/yourub/client.rb', line 32 def initialize( = {}) unless .empty? Yourub::Config.override_config_file() end args = { :key => config.developer_key, :application_name => config.application_name, :application_version => config.application_version, :authorization => nil } super(args) end |
Instance Attribute Details
#videos ⇒ Object (readonly)
Returns the value of attribute videos.
8 9 10 |
# File 'lib/yourub/client.rb', line 8 def videos @videos end |
Instance Method Details
#countries ⇒ Object
47 48 49 |
# File 'lib/yourub/client.rb', line 47 def countries Yourub::Validator.available_countries end |
#youtube_api ⇒ Object
it returns the youtube service object
53 54 55 56 57 |
# File 'lib/yourub/client.rb', line 53 def youtube_api @youtube_api ||= self.discovered_api( config.youtube_api_service_name, config.youtube_api_version ) end |