Class: Calculator
- Inherits:
-
Object
- Object
- Calculator
- Defined in:
- lib/calculator.rb
Instance Attribute Summary collapse
-
#memory ⇒ Object
Returns the value of attribute memory.
Instance Method Summary collapse
- #eval(expr) ⇒ Object
-
#initialize ⇒ Calculator
constructor
A new instance of Calculator.
Constructor Details
#initialize ⇒ Calculator
Returns a new instance of Calculator.
7 8 9 |
# File 'lib/calculator.rb', line 7 def initialize() @memory = 0 end |
Instance Attribute Details
#memory ⇒ Object
Returns the value of attribute memory.
5 6 7 |
# File 'lib/calculator.rb', line 5 def memory @memory end |