Skip to content

Instantly share code, notes, and snippets.

@thisismydesign
Last active June 28, 2019 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thisismydesign/b14bf3f8c7d14deec6ee6e8a9a3c35c6 to your computer and use it in GitHub Desktop.
Save thisismydesign/b14bf3f8c7d14deec6ee6e8a9a3c35c6 to your computer and use it in GitHub Desktop.
Debugging journal #1 - This will obviously not work. Right?.. /1
# irb / rails c / whatever
h = { a: "this", b: "that" }
h.select{ |k, v| v.match?("this") }
# => {:a=>"this"}
def matcher(string)
string.match?("this")
end
h.select(&:matcher)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment