Module: Vhx
- Defined in:
- lib/vhx.rb,
lib/vhx/error.rb,
lib/vhx/client.rb,
lib/vhx/version.rb,
lib/vhx/objects/site.rb,
lib/vhx/objects/user.rb,
lib/vhx/objects/video.rb,
lib/vhx/objects/product.rb,
lib/vhx/objects/customer.rb,
lib/vhx/middleware/oauth2.rb,
lib/vhx/objects/collection.rb,
lib/vhx/objects/video_file.rb,
lib/vhx/utilities/vhx_helper.rb,
lib/vhx/utilities/vhx_object.rb,
lib/vhx/objects/authorization.rb,
lib/vhx/objects/collection_item.rb,
lib/vhx/middleware/error_response.rb,
lib/vhx/utilities/vhx_list_object.rb,
lib/vhx/utilities/api_operations/list.rb,
lib/vhx/utilities/api_operations/create.rb,
lib/vhx/utilities/api_operations/delete.rb,
lib/vhx/utilities/api_operations/update.rb,
lib/vhx/utilities/api_operations/request.rb more...
Defined Under Namespace
Modules: ApiOperations, HelperMethods, Middleware
Classes: Authorization, BadRequestError, Client, Collection, Customer, InvalidResourceError, InvalidTokenError, NotAcceptableError, NotFoundError, PaymentRequiredError, Product, ServerError, Site, UnauthorizedError, User, VhxError, VhxListObject, VhxObject, Video
Constant Summary
collapse
- API_BASE_URL =
'https://api.vhx.tv'
- VERSION =
"0.0.7"
Class Method Summary
collapse
Class Method Details
[View source]
54
55
56
|
# File 'lib/vhx.rb', line 54
def client
@client
end
|
permalink
.client=(new_client) ⇒ Object
[View source]
58
59
60
|
# File 'lib/vhx.rb', line 58
def client=(new_client)
@client = new_client
end
|
permalink
.config(config = {}) ⇒ Object
[View source]
46
47
48
49
50
51
52
|
# File 'lib/vhx.rb', line 46
def config(config = {})
@client_id = config[:client_id]
@client_secret = config[:client_secret]
@api_key = config[:api_key]
@skip_auto_refresh = config[:skip_auto_refresh] || false
@api_base_url = config[:api_base]
end
|
permalink
.connection ⇒ Object
[View source]
62
63
64
|
# File 'lib/vhx.rb', line 62
def connection
client ? client.connection : nil
end
|
permalink
.setup(options = {}) ⇒ Object
[View source]
37
38
39
40
41
42
43
44
|
# File 'lib/vhx.rb', line 37
def setup(options = {})
options[:client_id] ||= @client_id
options[:client_secret] ||= @client_secret
options[:api_key] ||= @api_key
options[:api_base] ||= @api_base_url
options[:skip_auto_refresh] = @skip_auto_refresh if options[:skip_auto_refresh].nil?
Vhx.client = Vhx::Client.new(options)
end
|