Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple inspects #145

Open
JoshCheek opened this issue Dec 28, 2018 · 1 comment
Open

Multiple inspects #145

JoshCheek opened this issue Dec 28, 2018 · 1 comment

Comments

@JoshCheek
Copy link
Owner

In xmpfilter mode, when there are multiple output locations, it inspects multiple times. Not sure this is worth caring about:

require 'bigdecimal'  # => true

public def usd; BigDecimal self end
public def inr; BigDecimal(self) / 70 end
class BigDecimal
  def inspect
    sprintf("$%.2f", self).sub(/\d+/) {
      $& # => "1234", "1234"
    }
  end
end
n = BigDecimal '1234.56' # => $1234.56
# => $1234.56
@JoshCheek
Copy link
Owner Author

Simpler example:

s = ""
def s.inspect
  "s" # => "s", "s"
end
s # => s
# => s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant