Class: Samsara::Types::NumberFieldTypeMetaDataObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::NumberFieldTypeMetaDataObjectResponseBody
- Defined in:
- lib/samsara_api/types/number_field_type_meta_data_object_response_body.rb
Overview
The number field metadata.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#number_of_decimal_places ⇒ Long
readonly
The number of decimal places allowed for the field.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::NumberFieldTypeMetaDataObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(number_of_decimal_places: OMIT, additional_properties: nil) ⇒ Samsara::Types::NumberFieldTypeMetaDataObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(number_of_decimal_places: OMIT, additional_properties: nil) ⇒ Samsara::Types::NumberFieldTypeMetaDataObjectResponseBody
22 23 24 25 26 27 28 |
# File 'lib/samsara_api/types/number_field_type_meta_data_object_response_body.rb', line 22 def initialize(number_of_decimal_places: OMIT, additional_properties: nil) @number_of_decimal_places = number_of_decimal_places if number_of_decimal_places != OMIT @additional_properties = additional_properties @_field_set = { "numberOfDecimalPlaces": number_of_decimal_places }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
12 13 14 |
# File 'lib/samsara_api/types/number_field_type_meta_data_object_response_body.rb', line 12 def additional_properties @additional_properties end |
#number_of_decimal_places ⇒ Long (readonly)
Returns The number of decimal places allowed for the field.
10 11 12 |
# File 'lib/samsara_api/types/number_field_type_meta_data_object_response_body.rb', line 10 def number_of_decimal_places @number_of_decimal_places end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::NumberFieldTypeMetaDataObjectResponseBody
34 35 36 37 38 39 |
# File 'lib/samsara_api/types/number_field_type_meta_data_object_response_body.rb', line 34 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) number_of_decimal_places = parsed_json["numberOfDecimalPlaces"] new(number_of_decimal_places: number_of_decimal_places, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
53 54 55 |
# File 'lib/samsara_api/types/number_field_type_meta_data_object_response_body.rb', line 53 def self.validate_raw(obj:) obj.number_of_decimal_places&.is_a?(Long) != false || raise("Passed value for field obj.number_of_decimal_places is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
44 45 46 |
# File 'lib/samsara_api/types/number_field_type_meta_data_object_response_body.rb', line 44 def to_json @_field_set&.to_json end |