Class: Google::Apis::ComputeAlpha::FixedOrPercent
- Inherits:
-
Object
- Object
- Google::Apis::ComputeAlpha::FixedOrPercent
- Defined in:
- generated/google/apis/compute_alpha/classes.rb,
generated/google/apis/compute_alpha/representations.rb,
generated/google/apis/compute_alpha/representations.rb
Overview
Encapsulates numeric value that can be either absolute or relative.
Instance Attribute Summary collapse
-
#calculated ⇒ Fixnum
[Output Only] Absolute value calculated based on mode: mode = fixed -> calculated = fixed = percent -> calculated = ceiling(percent/100 * base_value) Corresponds to the JSON property
calculated. -
#fixed ⇒ Fixnum
fixed must be non-negative.
-
#percent ⇒ Fixnum
percent must belong to [0, 100].
Instance Method Summary collapse
-
#initialize(**args) ⇒ FixedOrPercent
constructor
A new instance of FixedOrPercent.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Google::Apis::Core::JsonObjectSupport
Methods included from Google::Apis::Core::Hashable
Constructor Details
#initialize(**args) ⇒ FixedOrPercent
Returns a new instance of FixedOrPercent
5417 5418 5419 |
# File 'generated/google/apis/compute_alpha/classes.rb', line 5417 def initialize(**args) update!(**args) end |
Instance Attribute Details
#calculated ⇒ Fixnum
[Output Only] Absolute value calculated based on mode: mode = fixed ->
calculated = fixed = percent -> calculated = ceiling(percent/100 * base_value)
Corresponds to the JSON property calculated
5405 5406 5407 |
# File 'generated/google/apis/compute_alpha/classes.rb', line 5405 def calculated @calculated end |
#fixed ⇒ Fixnum
fixed must be non-negative.
Corresponds to the JSON property fixed
5410 5411 5412 |
# File 'generated/google/apis/compute_alpha/classes.rb', line 5410 def fixed @fixed end |
#percent ⇒ Fixnum
percent must belong to [0, 100].
Corresponds to the JSON property percent
5415 5416 5417 |
# File 'generated/google/apis/compute_alpha/classes.rb', line 5415 def percent @percent end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
5422 5423 5424 5425 5426 |
# File 'generated/google/apis/compute_alpha/classes.rb', line 5422 def update!(**args) @calculated = args[:calculated] if args.key?(:calculated) @fixed = args[:fixed] if args.key?(:fixed) @percent = args[:percent] if args.key?(:percent) end |