Class: ComplexTest
Instance Attribute Summary collapse
-
#imaginary ⇒ Object
readonly
Returns the value of attribute imaginary.
-
#real ⇒ Object
readonly
Returns the value of attribute real.
Instance Method Summary collapse
- #add(other) ⇒ Object
-
#initialize(real, imaginary) ⇒ ComplexTest
constructor
A new instance of ComplexTest.
- #inspect ⇒ Object
- #real_add(other) ⇒ Object
Constructor Details
#initialize(real, imaginary) ⇒ ComplexTest
Returns a new instance of ComplexTest.
135 136 137 138 139 |
# File 'lib/rpdf2txt-rockit/profiler.rb', line 135 def initialize(real, imaginary) Profiler.__enter__(:initialize, real, imaginary) @real, @imaginary = real, imaginary Profiler.__leave__(:initialize, self) end |
Instance Attribute Details
#imaginary ⇒ Object (readonly)
Returns the value of attribute imaginary.
134 135 136 |
# File 'lib/rpdf2txt-rockit/profiler.rb', line 134 def imaginary @imaginary end |
#real ⇒ Object (readonly)
Returns the value of attribute real.
134 135 136 |
# File 'lib/rpdf2txt-rockit/profiler.rb', line 134 def real @real end |
Instance Method Details
#add(other) ⇒ Object
140 141 142 143 144 |
# File 'lib/rpdf2txt-rockit/profiler.rb', line 140 def add(other) Profiler.__enter__(:add, other) real_add(other) Profiler.__leave__(:add, self) end |
#inspect ⇒ Object
151 152 153 |
# File 'lib/rpdf2txt-rockit/profiler.rb', line 151 def inspect "#{real} + i*#{imaginary}" end |