Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Using CalculatorOperations module in the CalculatingIndividual module.

  • Loading branch information...
commit 0fb77c6f6ddbb891b34a6e084b2e653753a55487 1 parent 414e5c9
bishboria authored September 10, 2011
8  Examples/Calculator/features/lib/default/roles/calculating_individual.rb
... ...
@@ -1,4 +1,5 @@
1 1
 require 'calculator'
  2
+require 'calculator_operations'
2 3
 
3 4
 module CalculatingIndividual
4 5
 
@@ -8,10 +9,7 @@ def role_preparation
8 9
 
9 10
   def switch_on_the_calculator
10 11
     @calculator = Calculator.new
11  
-    @operate_with = {
12  
-      plus: :+,
13  
-     minus: :-
14  
-    }
  12
+    @operate_with = CalculatorOperations::OPERATIONS
15 13
   end
16 14
 
17 15
   def enter value
@@ -22,7 +20,7 @@ def press next_operator
22 20
     if next_operator == :equals
23 21
       equals
24 22
     else
25  
-      @calculator.get_ready_to @operate_with[next_operator]
  23
+      @calculator.get_ready_to @operate_with[next_operator.to_s]
26 24
     end
27 25
   end
28 26
 

0 notes on commit 0fb77c6

Please sign in to comment.
Something went wrong with that request. Please try again.