Class: Glimmer::Calculator::Command::AllClear

Inherits:
Glimmer::Calculator::Command show all
Defined in:
lib/models/glimmer/calculator/command/all_clear.rb

Instance Attribute Summary

Attributes inherited from Glimmer::Calculator::Command

#button, #result

Instance Method Summary collapse

Methods inherited from Glimmer::Calculator::Command

#command_history, command_history, for, #initialize, keyword, keyword_to_command_class_mapping, keywords, #last_command, #last_result, #number1, #number1=, #number2, #number2=, #operation, #operation=

Constructor Details

This class inherits a constructor from Glimmer::Calculator::Command

Instance Method Details

#executeObject



7
8
9
10
11
12
13
# File 'lib/models/glimmer/calculator/command/all_clear.rb', line 7

def execute
  self.result = '0'
  self.number1 = nil
  self.number2 = nil
  self.operation = nil
  command_history.clear
end