Class: AWSCDK::SizeConversionOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
size_conversion_options.rb

Overview

Options for how to convert time to a different unit.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rounding: nil) ⇒ SizeConversionOptions

Returns a new instance of SizeConversionOptions.

Parameters:

  • rounding (AWSCDK::SizeRoundingBehavior, nil) (defaults to: nil)

    How conversions should behave when it encounters a non-integer result.



8
9
10
11
# File 'size_conversion_options.rb', line 8

def initialize(rounding: nil)
  @rounding = rounding
  Jsii::Type.check_type(@rounding, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplUm91bmRpbmdCZWhhdmlvciJ9")), "rounding") unless @rounding.nil?
end

Instance Attribute Details

#roundingAWSCDK::SizeRoundingBehavior? (readonly)

Note:

Default: SizeRoundingBehavior.FAIL

How conversions should behave when it encounters a non-integer result.



17
18
19
# File 'size_conversion_options.rb', line 17

def rounding
  @rounding
end

Class Method Details

.jsii_propertiesObject



19
20
21
22
23
# File 'size_conversion_options.rb', line 19

def self.jsii_properties
  {
    :rounding => "rounding",
  }
end

Instance Method Details

#to_jsiiObject



25
26
27
28
29
30
31
# File 'size_conversion_options.rb', line 25

def to_jsii
  result = {}
  result.merge!({
    "rounding" => @rounding,
  })
  result.compact
end