mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 23:28:02 +00:00
Add Show Public Methods With Pry as a ruby til
This commit is contained in:
@@ -238,6 +238,7 @@ _310 TILs and counting..._
|
|||||||
- [Returning With Sequel](ruby/returning-with-sequel.md)
|
- [Returning With Sequel](ruby/returning-with-sequel.md)
|
||||||
- [Safe Navigation Operator](ruby/safe-navigation-operator.md)
|
- [Safe Navigation Operator](ruby/safe-navigation-operator.md)
|
||||||
- [Set RVM Default Ruby](ruby/set-rvm-default-ruby.md)
|
- [Set RVM Default Ruby](ruby/set-rvm-default-ruby.md)
|
||||||
|
- [Show Public Methods With Pry](ruby/show-public-methods-with-pry.md)
|
||||||
- [Squeeze Out The Extra Space](ruby/squeeze-out-the-extra-space.md)
|
- [Squeeze Out The Extra Space](ruby/squeeze-out-the-extra-space.md)
|
||||||
- [Summing Collections](ruby/summing-collections.md)
|
- [Summing Collections](ruby/summing-collections.md)
|
||||||
- [Uncaught Exceptions In Pry](ruby/uncaught-exceptions-in-pry.md)
|
- [Uncaught Exceptions In Pry](ruby/uncaught-exceptions-in-pry.md)
|
||||||
|
|||||||
17
ruby/show-public-methods-with-pry.md
Normal file
17
ruby/show-public-methods-with-pry.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Show Public Methods With Pry
|
||||||
|
|
||||||
|
Open up a [`pry`](https://github.com/pry/pry) session and use the `-m` flag
|
||||||
|
with the `ls` command to show just the public methods for an object.
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
> ls -m :hello
|
||||||
|
Comparable#methods: < <= > >= between?
|
||||||
|
Symbol#methods:
|
||||||
|
<=> as_json empty? length slice to_sym
|
||||||
|
== capitalize encoding match succ upcase
|
||||||
|
=== casecmp id2name next swapcase
|
||||||
|
=~ downcase inspect pretty_print_cycle to_proc
|
||||||
|
[] duplicable? intern size to_s
|
||||||
|
```
|
||||||
|
|
||||||
|
[source](https://github.com/pry/pry/wiki/State-navigation#Ls)
|
||||||
Reference in New Issue
Block a user