Skip to content

Instantly share code, notes, and snippets.

View joejag's full-sized avatar

Joe Wright joejag

View GitHub Profile
@joejag
joejag / calculator.rb
Last active December 21, 2015 15:08 — forked from mowat27/calculator.rb
class Calculator
def calculate(expresion)
return 0 if expresion.split.size != 3
parts = expresion.split
parts[0].to_i.send(parts[1], parts[2].to_i)
end
end
describe Calculator do
let(:calculator) { Calculator.new}