Class: OptionLab::Models::LaplaceInputs
- Defined in:
- lib/option_lab/models.rb
Overview
Laplace model inputs
Instance Attribute Summary collapse
-
#model ⇒ Object
Returns the value of attribute model.
-
#mu ⇒ Object
Returns the value of attribute mu.
-
#stock_price ⇒ Object
Returns the value of attribute stock_price.
-
#volatility ⇒ Object
Returns the value of attribute volatility.
-
#years_to_target_date ⇒ Object
Returns the value of attribute years_to_target_date.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(attributes = {}) ⇒ LaplaceInputs
constructor
A new instance of LaplaceInputs.
- #validate! ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ LaplaceInputs
Returns a new instance of LaplaceInputs.
544 545 546 547 548 549 550 551 |
# File 'lib/option_lab/models.rb', line 544 def initialize(attributes = {}) # Set defaults @model = 'laplace' super(attributes) validate! end |
Instance Attribute Details
#model ⇒ Object
Returns the value of attribute model.
542 543 544 |
# File 'lib/option_lab/models.rb', line 542 def model @model end |
#mu ⇒ Object
Returns the value of attribute mu.
542 543 544 |
# File 'lib/option_lab/models.rb', line 542 def mu @mu end |
#stock_price ⇒ Object
Returns the value of attribute stock_price.
542 543 544 |
# File 'lib/option_lab/models.rb', line 542 def stock_price @stock_price end |
#volatility ⇒ Object
Returns the value of attribute volatility.
542 543 544 |
# File 'lib/option_lab/models.rb', line 542 def volatility @volatility end |
#years_to_target_date ⇒ Object
Returns the value of attribute years_to_target_date.
542 543 544 |
# File 'lib/option_lab/models.rb', line 542 def years_to_target_date @years_to_target_date end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
557 558 559 560 561 562 563 564 565 |
# File 'lib/option_lab/models.rb', line 557 def ==(other) return false unless other.is_a?(LaplaceInputs) stock_price == other.stock_price && volatility == other.volatility && years_to_target_date == other.years_to_target_date && mu == other.mu && model == other.model end |
#hash ⇒ Object
569 570 571 |
# File 'lib/option_lab/models.rb', line 569 def hash [stock_price, volatility, years_to_target_date, mu, model].hash end |
#validate! ⇒ Object
553 554 555 |
# File 'lib/option_lab/models.rb', line 553 def validate! raise ArgumentError, "model must be 'laplace'" unless model == 'laplace' end |