Class: Vidsy::Data::API::Client
- Inherits:
-
Object
- Object
- Vidsy::Data::API::Client
- Defined in:
- lib/vidsy/data/api/client.rb
Constant Summary collapse
- @@config =
OpenStruct.new
Class Method Summary collapse
Class Method Details
.set_api_key(s) ⇒ Object
11 12 13 14 |
# File 'lib/vidsy/data/api/client.rb', line 11 def self.set_api_key(s) raise(ArgumentError, "API key must be String") unless s.is_a? String @@config.tap { |c| c.api_key = s } end |
.set_endpoint(s) ⇒ Object
16 17 18 19 |
# File 'lib/vidsy/data/api/client.rb', line 16 def self.set_endpoint(s) raise(ArgumentError, "Endpoint must be String") unless s.is_a? String @@config.tap { |c| c.endpoint = s } end |
.set_routes(h) ⇒ Object
21 22 23 24 |
# File 'lib/vidsy/data/api/client.rb', line 21 def self.set_routes(h) raise(ArgumentError, "Routes must be Hash") unless h.is_a? Hash @@config.tap { |c| c.routes = OpenStruct.new h } end |
.set_version(s) ⇒ Object
26 27 28 29 |
# File 'lib/vidsy/data/api/client.rb', line 26 def self.set_version(s) raise(ArgumentError, "Version must be String") unless s.is_a? String @@config.tap { |c| c.version = s } end |