Module: Vmix::Configuration

Included in:
Vmix
Defined in:
lib/vmix/configuration.rb

Constant Summary collapse

VALID_OPTIONS_KEYS =

An array of valid keys in the options hash when configuring a Oas::Client

[
:api_endpoint,
:download_endpoint,
:authentication,
:token,
:partner_id,
:api_password].freeze
DEFAULT_API_ENDPOINT =

The endpoint that will be used to connect if none is set

"api.vmixcore.com/apis".freeze
DEFAULT_DOWNLOAD_ENDPOINT =

The download endpoint that will be used to download media if none is set

"media.vmixcore.com/vmixcore/download".freeze
DEFAULT_AUTHENTICATION =

The account that will be used to connect if none is set

'token'.freeze
DEFAULT_TOKEN =

By default, don’t set a token

nil
DEFAULT_PARTNERID =

By default, don’t set a username

nil
DEFAULT_API_PASSWORD =

By default, don’t set a password

nil
VMIX_METHODS =
{
  # collection.php
  "collection" =>
    ["addCollectionToGroup",
    "addCollectionToGroup",
    "addMediaToCollection",
    "addNetworkMediaToAssets",
    "createCollection",
    "deleteCollection",
    "editCollection",
    "editCollectionMediaPosition",
    "editCollectionPrefs",
    "getCollectionMedias",
    "getCollectionPrefs",
    "getCollections",
    "getMediaCollections",
    "removeCollectionFromGroup",
    "removeMediaFromCollection",
    "removeNetworkMediaFromAssets"],

  # crypt.php
  "crypt" =>
    ["decrypt",
    "encrypt",
    "getKey"],

  # media.php

  "media" =>
    ["addToEncodeQueue",
    "createMetadataAttribute",
    "createSource",
    "genUploadToken",
    "getApprovalQueuedMediaCount",
    "getApprovalQueuedMedias",
    "getMedia",
    "getMediaCount",
    "getMediaFiles",
    "getMediaList",
    "getMediaMetadata",
    "getMediaUrl",
    "getMetadataAttributes",
    "getSource",
    "getStatusMap",
    "insertApprovalQueue",
    "removeFromApprovalQueue",
    "searchMedia",
    "setDefaultThumbnail",
    "updateMediaData"],

  # ReportedPost.php

  "ReportedPost" =>
    ["getReports",
    "editReportStatus",
    "createReport"],

  # stats.php

  "stats" =>
    ["getTopRankedMedia",
    "getRatingRankedMedia"],

  # comments.php
  "comments" =>
    ["addComment",
    "editComment",
    "editCommentStatus",
    "getComment",
    "getComments",
    "getCount"],

  # genre.php
  "genre" =>
    ["createGenre",
    "deleteGenre",
    "editGenre",
    "getGenres"],


  # ratings.php

  "ratings" =>
    ["createRatingGroup",
    "createRatingSystem",
    "deleteRatingSystemGroup",
    "createRatingSystemGroup",
    "getRatingGroups",
    "getRatings",
    "getRatingSummaries",
    "getRatingSummary",
    "getRatingSystems",
    "getRatingSystemsByGroup",
    "saveRatings",
    "updateRating",
    "updateRatingGroup",
    "updateRatingSystem"],


  # reports.php

  "reports" =>
    ["getTopApplications",
    "getTopCollections",
    "getTopDomains",
    "getTopGenres",
    "getTopMedia",
    "getTopPartners",
    "getExposure"],


  # tags.php

  "tags" =>
    ["createTags",
    "deleteTags",
    "fetchTagCloud",
    "fetchTags",
    "fetchTagsByTargetIds",
    "fetchTargetsByTag",
    "replaceTags"],
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



32
33
34
# File 'lib/vmix/configuration.rb', line 32

def self.extended(base)
  base.reset
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



36
37
38
# File 'lib/vmix/configuration.rb', line 36

def configure
  yield self if block_given?
end

#optionsObject



40
41
42
43
44
# File 'lib/vmix/configuration.rb', line 40

def options
  options = {}
  VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) }
  options
end

#resetObject



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

def reset
  self.api_endpoint = DEFAULT_API_ENDPOINT
  self.download_endpoint = DEFAULT_DOWNLOAD_ENDPOINT
  self.authentication = DEFAULT_AUTHENTICATION
  self.token = DEFAULT_TOKEN
  self.partner_id = DEFAULT_PARTNERID
  self.api_password = DEFAULT_API_PASSWORD
end