Ruby String Calculate Method