Class: NewDemoApiClient::Area
- Inherits:
-
Object
- Object
- NewDemoApiClient::Area
- Defined in:
- lib/test_sdk/types/area.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#alpha ⇒ Float
readonly
Quantile significance level for the area, which represents the share of data points expected to lie beyond the band.
-
#x ⇒ Array<Float>
readonly
List of x values for the area.
-
#y ⇒ Array<Float>
readonly
List of y values for the area.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::Area
Deserialize a JSON object to an instance of Area.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(alpha:, x:, y:, additional_properties: nil) ⇒ NewDemoApiClient::Area constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Area to a JSON object.
Constructor Details
#initialize(alpha:, x:, y:, additional_properties: nil) ⇒ NewDemoApiClient::Area
29 30 31 32 33 34 35 |
# File 'lib/test_sdk/types/area.rb', line 29 def initialize(alpha:, x:, y:, additional_properties: nil) @alpha = alpha @x = x @y = y @additional_properties = additional_properties @_field_set = { "alpha": alpha, "x": x, "y": y } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/test_sdk/types/area.rb', line 16 def additional_properties @additional_properties end |
#alpha ⇒ Float (readonly)
Returns Quantile significance level for the area, which represents the share of data points expected to lie beyond the band.
10 11 12 |
# File 'lib/test_sdk/types/area.rb', line 10 def alpha @alpha end |
#x ⇒ Array<Float> (readonly)
Returns List of x values for the area.
12 13 14 |
# File 'lib/test_sdk/types/area.rb', line 12 def x @x end |
#y ⇒ Array<Float> (readonly)
Returns List of y values for the area.
14 15 16 |
# File 'lib/test_sdk/types/area.rb', line 14 def y @y end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::Area
Deserialize a JSON object to an instance of Area
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/test_sdk/types/area.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) alpha = parsed_json["alpha"] x = parsed_json["x"] y = parsed_json["y"] new( alpha: alpha, x: x, y: y, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
68 69 70 71 72 |
# File 'lib/test_sdk/types/area.rb', line 68 def self.validate_raw(obj:) obj.alpha.is_a?(Float) != false || raise("Passed value for field obj.alpha is not the expected type, validation failed.") obj.x.is_a?(Array) != false || raise("Passed value for field obj.x is not the expected type, validation failed.") obj.y.is_a?(Array) != false || raise("Passed value for field obj.y is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of Area to a JSON object
58 59 60 |
# File 'lib/test_sdk/types/area.rb', line 58 def to_json(*_args) @_field_set&.to_json end |