Sha256: 828f4b48d66a6bd705fc9600749509f71b21d75e501202564a4ac49636dc22d5
Contents?: true
Size: 487 Bytes
Versions: 118
Compression:
Stored size: 487 Bytes
Contents
class Calculator module Model class Command class Point < Command keyword '.' def execute self.result = last_result.nil? || !last_command.is_a?(Number) ? '0.' : "#{last_result}." if operation.nil? || last_command.is_a?(Equals) self.number1 = self.result self.number2 = nil self.operation = nil else self.number2 = self.result end end end end end end
Version data entries
118 entries across 118 versions & 1 rubygems