Class: Bitmovin::Output
- Inherits:
-
Object
- Object
- Bitmovin::Output
- Extended by:
- Helpers
- Includes:
- Helpers
- Defined in:
- lib/bitmovin/output.rb
Overview
Represents a bitmovin Output
Constant Summary collapse
- ATTRIBUTES =
%i{ output_id type name bucket region access_key secret_key account_name account_key container prefix make_public create_sub_directory created_at }
Constants included from Helpers
Helpers::S3_BUCKET_IN_URL_REGEX, Helpers::S3_BUCKET_SUBDOMAIN_REGEX, Helpers::S3_OBJECT_KEY_IN_URL_REGEX, Helpers::S3_OBJECT_KEY_SUBDOMAIN_REGEX
Class Method Summary collapse
-
.create(params = {}) ⇒ Bitmovin::Output
Creates a new bitmovin output.
-
.list(page = 1, reload = false) ⇒ Array<Bitmovin::Output>
Get lsit of available bitmovin outputs (10 per page).
Instance Method Summary collapse
-
#create ⇒ Bitmovin::Input
Creates a new bitmovin output with params given within initialization.
-
#details(reload = false) ⇒ Hash
Get bitmovin input details.
-
#initialize(params = {}) ⇒ Output
constructor
A new instance of Output.
Methods included from Helpers
deep_camelize_keys, deep_underscore_keys, extract_bucket, extract_object_key, prepare_request_json, prepare_response_json
Constructor Details
#initialize(params = {}) ⇒ Output
Returns a new instance of Output.
55 56 57 |
# File 'lib/bitmovin/output.rb', line 55 def initialize(params={}) @details = params end |
Class Method Details
.create(params = {}) ⇒ Bitmovin::Output
Creates a new bitmovin output
66 67 68 |
# File 'lib/bitmovin/output.rb', line 66 def self.create(params={}) new(params).create end |
.list(page = 1, reload = false) ⇒ Array<Bitmovin::Output>
Get lsit of available bitmovin outputs (10 per page)
99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/bitmovin/output.rb', line 99 def list(page = 1, reload = false) var_name = :"@list_p#{ page }" val = instance_variable_get var_name return val if val && !reload get = Net::HTTP::Get.new "/api/outputs/?page=#{ page }", initheaders = headers response = Bitmovin.http.request get list = prepare_response_json(response.body).map { |output| Bitmovin::Output.new(output) } val = instance_variable_set var_name, list end |
Instance Method Details
#create ⇒ Bitmovin::Input
Creates a new bitmovin output with params given within initialization
74 75 76 |
# File 'lib/bitmovin/output.rb', line 74 def create make_create_request end |
#details(reload = false) ⇒ Hash
Get bitmovin input details
82 83 84 85 86 |
# File 'lib/bitmovin/output.rb', line 82 def details(reload = false) return @details if !reload && @details reload_details end |