Class: Bitmovin::Input
- Inherits:
-
Object
- Object
- Bitmovin::Input
- Includes:
- Helpers
- Defined in:
- lib/bitmovin/input.rb
Overview
Represents a bitmovin input
Constant Summary collapse
- ATTRIBUTES =
i{ input_id async type url username password created_at region bucket object_key access_key secret_key account_name account_key container min_bandwidth max_bandwidth }
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
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
-
.create(*args) ⇒ Bitmovin::Input
Creates a new bitmovin input.
Instance Method Summary collapse
-
#create ⇒ Bitmovin::Input
Creates a new bitmovin input with params given within initialization.
-
#details(reload = false) ⇒ Object
Get bitmovin input details.
-
#initialize(*args) ⇒ Hash
constructor
Input details as a hash.
Methods included from Helpers
#deep_camelize_keys, #deep_underscore_keys, #extract_bucket, #extract_object_key, #prepare_request_json, #prepare_response_json
Constructor Details
#initialize(url, params) ⇒ Hash #initialize(params) ⇒ Hash
Returns Input details as a hash.
85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/bitmovin/input.rb', line 85 def initialize(*args) @params = args.pop @url = args.pop if args.length == 1 if @url @params[:bucket] = extract_bucket(url) if !@params[:bucket] && @params[:type] == "s3" @params[:object_key] = extract_object_key(url) if !@params[:object_key] && @params[:type] == "s3" @params[:url] end end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
43 44 45 |
# File 'lib/bitmovin/input.rb', line 43 def params @params end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
43 44 45 |
# File 'lib/bitmovin/input.rb', line 43 def url @url end |
Class Method Details
.create(*args) ⇒ Bitmovin::Input
Creates a new bitmovin input
104 105 106 |
# File 'lib/bitmovin/input.rb', line 104 def self.create(*args) new(*args).create end |
Instance Method Details
#create ⇒ Bitmovin::Input
Creates a new bitmovin input with params given within initialization
112 113 114 |
# File 'lib/bitmovin/input.rb', line 112 def create make_create_request end |
#details(reload = false) ⇒ Object
Get bitmovin input details
119 120 121 122 123 |
# File 'lib/bitmovin/input.rb', line 119 def details(reload = false) return @params if !reload && @params reload_details end |