Class: ApiReference::ScalableMatrixWithUnitScalingFactor
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::ScalableMatrixWithUnitScalingFactor
- Defined in:
- lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb
Overview
Configuration for a single matrix scaling factor
Instance Attribute Summary collapse
-
#first_dimension_value ⇒ String
TODO: Write general description for this method.
-
#scaling_factor ⇒ String
TODO: Write general description for this method.
-
#second_dimension_value ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(first_dimension_value:, scaling_factor:, second_dimension_value: SKIP) ⇒ ScalableMatrixWithUnitScalingFactor
constructor
A new instance of ScalableMatrixWithUnitScalingFactor.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(first_dimension_value:, scaling_factor:, second_dimension_value: SKIP) ⇒ ScalableMatrixWithUnitScalingFactor
Returns a new instance of ScalableMatrixWithUnitScalingFactor.
47 48 49 50 51 52 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 47 def initialize(first_dimension_value:, scaling_factor:, second_dimension_value: SKIP) @first_dimension_value = first_dimension_value @second_dimension_value = second_dimension_value unless second_dimension_value == SKIP @scaling_factor = scaling_factor end |
Instance Attribute Details
#first_dimension_value ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 14 def first_dimension_value @first_dimension_value end |
#scaling_factor ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 22 def scaling_factor @scaling_factor end |
#second_dimension_value ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 18 def second_dimension_value @second_dimension_value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 55 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. first_dimension_value = hash.key?('first_dimension_value') ? hash['first_dimension_value'] : nil scaling_factor = hash.key?('scaling_factor') ? hash['scaling_factor'] : nil second_dimension_value = hash.key?('second_dimension_value') ? hash['second_dimension_value'] : SKIP # Create object from extracted values. ScalableMatrixWithUnitScalingFactor.new(first_dimension_value: first_dimension_value, scaling_factor: scaling_factor, second_dimension_value: second_dimension_value) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['first_dimension_value'] = 'first_dimension_value' @_hash['second_dimension_value'] = 'second_dimension_value' @_hash['scaling_factor'] = 'scaling_factor' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 44 45 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 41 def self.nullables %w[ second_dimension_value ] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 34 def self.optionals %w[ second_dimension_value ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 74 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.first_dimension_value, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.scaling_factor, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['first_dimension_value'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['scaling_factor'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
102 103 104 105 106 107 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 102 def inspect class_name = self.class.name.split('::').last "<#{class_name} first_dimension_value: #{@first_dimension_value.inspect},"\ " second_dimension_value: #{@second_dimension_value.inspect}, scaling_factor:"\ " #{@scaling_factor.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 |
# File 'lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} first_dimension_value: #{@first_dimension_value}, second_dimension_value:"\ " #{@second_dimension_value}, scaling_factor: #{@scaling_factor}>" end |