Class: NewDemoApiClient::FinancialMetrics
- Inherits:
-
Object
- Object
- NewDemoApiClient::FinancialMetrics
- Defined in:
- lib/test_sdk/types/financial_metrics.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#burn_multiple ⇒ Float
readonly
The burn multiple, defined as the cash burn divided by the revenue growth, with slight smoothing to handle variations.
-
#date ⇒ String
readonly
The date of the financial metrics.
-
#lifetime_gross_margin ⇒ Float
readonly
The lifetime gross margin, integrated over all time.
-
#lifetime_operating_margin ⇒ Float
readonly
The lifetime operating margin, integrated over all time.
-
#magic_number ⇒ Float
readonly
The magic number, defined as the revenue growth divided by the offset sales and marketing cost, with slight smoothing to handle variations.
-
#rule_of40 ⇒ Float
readonly
The rule of 40, defined as the year over year growth plus the operating margin, with slight smoothing to handle variations.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::FinancialMetrics
Deserialize a JSON object to an instance of FinancialMetrics.
-
.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(date:, lifetime_gross_margin: OMIT, lifetime_operating_margin: OMIT, rule_of40: OMIT, magic_number: OMIT, burn_multiple: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::FinancialMetrics constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of FinancialMetrics to a JSON object.
Constructor Details
#initialize(date:, lifetime_gross_margin: OMIT, lifetime_operating_margin: OMIT, rule_of40: OMIT, magic_number: OMIT, burn_multiple: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::FinancialMetrics
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 46 def initialize(date:, lifetime_gross_margin: OMIT, lifetime_operating_margin: OMIT, rule_of40: OMIT, magic_number: OMIT, burn_multiple: OMIT, additional_properties: nil) @date = date @lifetime_gross_margin = lifetime_gross_margin if lifetime_gross_margin != OMIT @lifetime_operating_margin = if != OMIT @rule_of40 = rule_of40 if rule_of40 != OMIT @magic_number = magic_number if magic_number != OMIT @burn_multiple = burn_multiple if burn_multiple != OMIT @additional_properties = additional_properties @_field_set = { "date": date, "lifetime_gross_margin": lifetime_gross_margin, "lifetime_operating_margin": , "rule_of_40": rule_of40, "magic_number": magic_number, "burn_multiple": burn_multiple }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
26 27 28 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 26 def additional_properties @additional_properties end |
#burn_multiple ⇒ Float (readonly)
Returns The burn multiple, defined as the cash burn divided by the revenue growth, with slight smoothing to handle variations. The operating margin is used in place of the cash burn if the cash burn is not available. Not defined if the revenue growth is negative.
24 25 26 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 24 def burn_multiple @burn_multiple end |
#date ⇒ String (readonly)
Returns The date of the financial metrics.
9 10 11 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 9 def date @date end |
#lifetime_gross_margin ⇒ Float (readonly)
Returns The lifetime gross margin, integrated over all time.
11 12 13 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 11 def lifetime_gross_margin @lifetime_gross_margin end |
#lifetime_operating_margin ⇒ Float (readonly)
Returns The lifetime operating margin, integrated over all time.
13 14 15 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 13 def @lifetime_operating_margin end |
#magic_number ⇒ Float (readonly)
Returns The magic number, defined as the revenue growth divided by the offset sales and marketing cost, with slight smoothing to handle variations.
19 20 21 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 19 def magic_number @magic_number end |
#rule_of40 ⇒ Float (readonly)
Returns The rule of 40, defined as the year over year growth plus the operating margin, with slight smoothing to handle variations.
16 17 18 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 16 def rule_of40 @rule_of40 end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::FinancialMetrics
Deserialize a JSON object to an instance of FinancialMetrics
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 71 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) date = parsed_json["date"] lifetime_gross_margin = parsed_json["lifetime_gross_margin"] = parsed_json["lifetime_operating_margin"] rule_of40 = parsed_json["rule_of_40"] magic_number = parsed_json["magic_number"] burn_multiple = parsed_json["burn_multiple"] new( date: date, lifetime_gross_margin: lifetime_gross_margin, lifetime_operating_margin: , rule_of40: rule_of40, magic_number: magic_number, burn_multiple: burn_multiple, 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.
104 105 106 107 108 109 110 111 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 104 def self.validate_raw(obj:) obj.date.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.") obj.lifetime_gross_margin&.is_a?(Float) != false || raise("Passed value for field obj.lifetime_gross_margin is not the expected type, validation failed.") obj.&.is_a?(Float) != false || raise("Passed value for field obj.lifetime_operating_margin is not the expected type, validation failed.") obj.rule_of40&.is_a?(Float) != false || raise("Passed value for field obj.rule_of40 is not the expected type, validation failed.") obj.magic_number&.is_a?(Float) != false || raise("Passed value for field obj.magic_number is not the expected type, validation failed.") obj.burn_multiple&.is_a?(Float) != false || raise("Passed value for field obj.burn_multiple is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of FinancialMetrics to a JSON object
94 95 96 |
# File 'lib/test_sdk/types/financial_metrics.rb', line 94 def to_json(*_args) @_field_set&.to_json end |