Class: Google::Apis::ManufacturersV1::FloatUnit

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/manufacturers_v1/classes.rb,
lib/google/apis/manufacturers_v1/representations.rb,
lib/google/apis/manufacturers_v1/representations.rb

Overview

Combination of float amount and unit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ FloatUnit

Returns a new instance of FloatUnit.



452
453
454
# File 'lib/google/apis/manufacturers_v1/classes.rb', line 452

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#amountFloat

amount. Corresponds to the JSON property amount

Returns:

  • (Float)


445
446
447
# File 'lib/google/apis/manufacturers_v1/classes.rb', line 445

def amount
  @amount
end

#unitString

unit. Corresponds to the JSON property unit

Returns:

  • (String)


450
451
452
# File 'lib/google/apis/manufacturers_v1/classes.rb', line 450

def unit
  @unit
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



457
458
459
460
# File 'lib/google/apis/manufacturers_v1/classes.rb', line 457

def update!(**args)
  @amount = args[:amount] if args.key?(:amount)
  @unit = args[:unit] if args.key?(:unit)
end