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

Meta Doc Utilities #81

Open
delonnewman opened this issue Jul 13, 2022 · 0 comments
Open

Meta Doc Utilities #81

delonnewman opened this issue Jul 13, 2022 · 0 comments

Comments

@delonnewman
Copy link
Owner

delonnewman commented Jul 13, 2022

def method_query(object:, args: [], output:)
  object.methods.select { |m| begin object.dup.public_send(m, *args) == output; rescue => e; nil end }
end
method_query(object: "test", output: "TEST") # => [:upcase, :upcase!, :swapcase, :swapcase!]

See Also: #49, #61, #17

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