Class: EngineeringCalculator::Calculator

Inherits:
Object
  • Object
show all
Defined in:
lib/engineering_calculator/calculator.rb

Constant Summary collapse

@@current_calculator =
nil

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.calculator_listObject



25
26
27
# File 'lib/engineering_calculator/calculator.rb', line 25

def self.calculator_list
  make_calculator_list
end

.function(fun) ⇒ Object



37
38
39
# File 'lib/engineering_calculator/calculator.rb', line 37

def self.function(fun)
  perform(fun)
end

.functionsObject



33
34
35
# File 'lib/engineering_calculator/calculator.rb', line 33

def self.functions
  list_functions
end

.use_calculator(calculator_number) ⇒ Object



29
30
31
# File 'lib/engineering_calculator/calculator.rb', line 29

def self.use_calculator(calculator_number)
  set_calculator(calculator_number)
end

Instance Method Details

#launchObject



12
13
14
15
# File 'lib/engineering_calculator/calculator.rb', line 12

def launch
  OutputManager.display_welcome
  main_loop
end

#main_loopObject



17
18
19
20
21
22
23
# File 'lib/engineering_calculator/calculator.rb', line 17

def main_loop
  response = nil
  OutputManager.display_actions
  while response != :quit
    response = prompt_user
  end
end