Class: AWSCDK::Bitrate

Inherits:
Jsii::Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Bitrate

Returns a new instance of Bitrate.

Raises:

  • (NoMethodError)


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.

Parameters:

  • amount (Numeric)

    the amount of bits per second.

Returns:

  • (AWSCDK::Bitrate)


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.

Parameters:

  • amount (Numeric)

    the amount of gigabits per second.

Returns:

  • (AWSCDK::Bitrate)


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_methodsObject



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.

Parameters:

  • amount (Numeric)

    the amount of kilobits per second.

Returns:

  • (AWSCDK::Bitrate)


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.

Parameters:

  • amount (Numeric)

    the amount of megabits per second.

Returns:

  • (AWSCDK::Bitrate)


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_unresolvedBoolean

Checks if bitrate is a token or a resolvable object.

Returns:

  • (Boolean)


66
67
68
# File 'bitrate.rb', line 66

def is_unresolved()
  jsii_call_method("isUnresolved", [])
end

#to_bpsNumeric

Return the total number of bits per second.

Returns:

  • (Numeric)


73
74
75
# File 'bitrate.rb', line 73

def to_bps()
  jsii_call_method("toBps", [])
end

#to_gbpsNumeric

Return the total number of gigabits per second.

Returns:

  • (Numeric)


80
81
82
# File 'bitrate.rb', line 80

def to_gbps()
  jsii_call_method("toGbps", [])
end

#to_kbpsNumeric

Return the total number of kilobits per second.

Returns:

  • (Numeric)


87
88
89
# File 'bitrate.rb', line 87

def to_kbps()
  jsii_call_method("toKbps", [])
end

#to_mbpsNumeric

Return the total number of megabits per second.

Returns:

  • (Numeric)


94
95
96
# File 'bitrate.rb', line 94

def to_mbps()
  jsii_call_method("toMbps", [])
end