Class: Dydx::Delta
- Inherits:
-
Object
- Object
- Dydx::Delta
- Defined in:
- lib/dydx/delta.rb
Instance Attribute Summary collapse
-
#function ⇒ Object
Returns the value of attribute function.
-
#var ⇒ Object
Returns the value of attribute var.
Instance Method Summary collapse
- #/(delta) ⇒ Object
-
#initialize(var = nil, function = nil) ⇒ Delta
constructor
A new instance of Delta.
Constructor Details
#initialize(var = nil, function = nil) ⇒ Delta
Returns a new instance of Delta.
4 5 6 7 |
# File 'lib/dydx/delta.rb', line 4 def initialize(var = nil, function = nil) @var = var @function = function end |
Instance Attribute Details
#function ⇒ Object
Returns the value of attribute function.
3 4 5 |
# File 'lib/dydx/delta.rb', line 3 def function @function end |
#var ⇒ Object
Returns the value of attribute var.
3 4 5 |
# File 'lib/dydx/delta.rb', line 3 def var @var end |
Instance Method Details
#/(delta) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/dydx/delta.rb', line 9 def /(delta) if var eval("$#{var}").differentiate(delta.var) elsif delta.function delta.function.differentiate(delta.var) end end |