Class: AWSCDK::Bitrate
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::Bitrate
- Defined in:
- bitrate.rb
Overview
Represents a bitrate value.
The amount can be specified either as a literal value (e.g: 10) which
cannot be negative, or as an unresolved number token.
When the amount is passed as a token, unit conversion is not possible.
Class Method Summary collapse
-
.bps(amount) ⇒ AWSCDK::Bitrate
Create a Bitrate representing an amount of bits per second.
-
.gbps(amount) ⇒ AWSCDK::Bitrate
Create a Bitrate representing an amount of gigabits per second.
- .jsii_overridable_methods ⇒ Object
-
.kbps(amount) ⇒ AWSCDK::Bitrate
Create a Bitrate representing an amount of kilobits per second.
-
.mbps(amount) ⇒ AWSCDK::Bitrate
Create a Bitrate representing an amount of megabits per second.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Bitrate
constructor
A new instance of Bitrate.
-
#is_unresolved ⇒ Boolean
Checks if bitrate is a token or a resolvable object.
-
#to_bps ⇒ Numeric
Return the total number of bits per second.
-
#to_gbps ⇒ Numeric
Return the total number of gigabits per second.
-
#to_kbps ⇒ Numeric
Return the total number of kilobits per second.
-
#to_mbps ⇒ Numeric
Return the total number of megabits per second.
Constructor Details
#initialize(*args) ⇒ Bitrate
Returns a new instance of Bitrate.
13 14 15 |
# File 'bitrate.rb', line 13 def initialize(*args) raise NoMethodError, "aws-cdk-lib.Bitrate does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.bps(amount) ⇒ AWSCDK::Bitrate
Create a Bitrate representing an amount of bits per second.
31 32 33 34 |
# File 'bitrate.rb', line 31 def self.bps(amount) Jsii::Type.check_type(amount, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "amount") Jsii::Kernel.instance.call_static("aws-cdk-lib.Bitrate", "bps", [amount]) end |
.gbps(amount) ⇒ AWSCDK::Bitrate
Create a Bitrate representing an amount of gigabits per second.
40 41 42 43 |
# File 'bitrate.rb', line 40 def self.gbps(amount) Jsii::Type.check_type(amount, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "amount") Jsii::Kernel.instance.call_static("aws-cdk-lib.Bitrate", "gbps", [amount]) end |
.jsii_overridable_methods ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'bitrate.rb', line 17 def self.jsii_overridable_methods { :is_unresolved => { kind: :method, name: "isUnresolved", is_optional: false }, :to_bps => { kind: :method, name: "toBps", is_optional: false }, :to_gbps => { kind: :method, name: "toGbps", is_optional: false }, :to_kbps => { kind: :method, name: "toKbps", is_optional: false }, :to_mbps => { kind: :method, name: "toMbps", is_optional: false }, } end |
.kbps(amount) ⇒ AWSCDK::Bitrate
Create a Bitrate representing an amount of kilobits per second.
49 50 51 52 |
# File 'bitrate.rb', line 49 def self.kbps(amount) Jsii::Type.check_type(amount, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "amount") Jsii::Kernel.instance.call_static("aws-cdk-lib.Bitrate", "kbps", [amount]) end |
.mbps(amount) ⇒ AWSCDK::Bitrate
Create a Bitrate representing an amount of megabits per second.
58 59 60 61 |
# File 'bitrate.rb', line 58 def self.mbps(amount) Jsii::Type.check_type(amount, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "amount") Jsii::Kernel.instance.call_static("aws-cdk-lib.Bitrate", "mbps", [amount]) end |
Instance Method Details
#is_unresolved ⇒ Boolean
Checks if bitrate is a token or a resolvable object.
66 67 68 |
# File 'bitrate.rb', line 66 def is_unresolved() jsii_call_method("isUnresolved", []) end |
#to_bps ⇒ Numeric
Return the total number of bits per second.
73 74 75 |
# File 'bitrate.rb', line 73 def to_bps() jsii_call_method("toBps", []) end |
#to_gbps ⇒ Numeric
Return the total number of gigabits per second.
80 81 82 |
# File 'bitrate.rb', line 80 def to_gbps() jsii_call_method("toGbps", []) end |
#to_kbps ⇒ Numeric
Return the total number of kilobits per second.
87 88 89 |
# File 'bitrate.rb', line 87 def to_kbps() jsii_call_method("toKbps", []) end |
#to_mbps ⇒ Numeric
Return the total number of megabits per second.
94 95 96 |
# File 'bitrate.rb', line 94 def to_mbps() jsii_call_method("toMbps", []) end |