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/analytics.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

Defined Under Namespace

Modules: ApiOperations, HelperMethods, Middleware Classes: Analytics, 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.8"

Class Method Summary collapse

Class Method Details

.clientObject


55
56
57
# File 'lib/vhx.rb', line 55

def client
  @client
end

.client=(new_client) ⇒ Object


59
60
61
# File 'lib/vhx.rb', line 59

def client=(new_client)
  @client = new_client
end

.config(config = {}) ⇒ Object


47
48
49
50
51
52
53
# File 'lib/vhx.rb', line 47

def config(config = {})
  @client_id          = config[:client_id]
  @client_secret      = config[:client_secret]
  @api_key            = config[:api_key]
  @auto_refresh       = config[:auto_refresh] || false
  @api_base_url       = config[:api_base]
end

.connectionObject


63
64
65
# File 'lib/vhx.rb', line 63

def connection
  client ? client.connection : nil
end

.setup(options = {}) ⇒ Object


38
39
40
41
42
43
44
45
# File 'lib/vhx.rb', line 38

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[:auto_refresh]        = @auto_refresh || false 
  Vhx.client = Vhx::Client.new(options)
end